When first written, many programSequences of instructions for a computer. contain bugAn error in a program. (errors). syntax errorError in a program resulting from code not following syntax rules governing how to write statements in a programming language. are usually quickly removed, but it can take a long time to deduce where a logic errorError in a program which does not cause a program to crash but causes unexpected results. is occurring and why. The purpose of testingAn important part of computer programming which involves checking a program for errors. 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.