Testing
Testing means running a program, or part of a program, with data you have chosen, to check that it works. You pick the data on purpose so that the test has a point: you already know what the program should do with it.
The main purpose of testing is to find errors so that they can be fixed. A program with errors in it will cause problems for whoever uses it, so the sooner the errors are found, the better.
Testing happens before the program is released so that the errors found can be fixed while there is still time to change the code. A test that fails is useful: it proves the program does not yet work as intended and gives you a place to start looking. You can then correct the code and run the same test again.
One thing testing cannot do is prove that a program has no errors at all. You can only try the data you think of, and an untested path through the program may still hide a problem. Testing finds errors so they can be fixed; it does not guarantee a perfect program.
OCR GCSE Computer Science · Testing