Producing robust programs - OCRThe purpose and types of testing

Programs must run correctly or they are of little value. Careful planning and testing of a program are essential, as is writing maintainable code.

Part ofComputer ScienceComputational thinking, algorithms and programming

The purpose and types of testing

When first written, many contain (errors). are usually quickly removed, but it can take a long time to deduce where a is occurring and why. The purpose of is to help the programmer remove such bugs and to ensure that the program functions as intended.

Testing is carried out in various ways:

  • Iterative testing is carried out while a program is being developed. The programmer writes a section of code (module) then tests it. The module may work fine, but more likely the programmer will amend or fix the code, and test it again. The process repeats (iterates) until the module works as intended.
  • Final (terminal) testing is carried out when all modules are complete and the program is tested as a whole to ensure that it functions as it should.