The main purpose of testing is to ensure that a program works correctly no matter what input has been entered by the user.
Other reasons to test a program include ensuring the user requirements have been met, errors have been removed and the program doesn't crash while running.
Types of Testing
Iterative testing takes place during program development.
The programmer develops a module, tests it and repeats this process until the module works as expected.
Final testing, also known as terminal testing, takes place after development and before the program is released to the end user.
This testing takes place once all modules have been individually tested to ensure the whole program works as originally expected.
A syntax error is a mistake in the grammar or spelling of the program.
A syntax error will prevent the program from being compiled.
A logical error is a mistake made by the programmer - the program still works but displays the wrong output.
total = num1 - num2
Incorrect variable printed:
age = 16
name = "Steve"
print ("Nice to meet you" , age)
Test data is used to test whether a program is functioning correctly.
It should cover a range of possible and incorrect inputs, each designed to prove a program works or to highlight any flaws.
Three types of test data are:
Normal data - Sensible data that the program should accept and be able to process.
Boundary data - Data at the extreme boundary of any data ranges.
Invalid (AKA Erroneous) data - Data that the program cannot process and should not accept.
3.2 - Testing:
1. Give 3 reasons why programs are tested. 
2. What is the difference between iterative and final testing? 
3a. What is a syntax error? Give an example. 
3b. What is a logical error? Give an example. 
4. State and describe the three types of test data.