Testing Programs
Aligned to the OCR J277 specification
- Level
- Intermediate
- Reading time
- 8 min
- Published
- 11 June 2026
- Updated
- 1 July 2026
On this page
Key takeaways
- Iterative testing happens during development, testing each component as it is written so bugs are caught and fixed early; final (terminal) testing happens on the complete program at the end.
- A syntax error prevents the program from running at all because the code breaks the grammatical rules of the language; a logic error allows the program to run but produces incorrect results.
- The four test data categories are: normal (valid data in the middle of the range), boundary (valid data at the exact limits), invalid (correct type but outside the range), and erroneous (wrong data type entirely).
- Boundary values catch off-by-one errors that normal values in the middle of the range will miss; always test both the lower and upper boundaries.
- A common mistake is classifying erroneous data as invalid: invalid data is the right type but wrong range (e.g. -1 for an age field), while erroneous data is the wrong type entirely (e.g. "hello").
Something not quite clicking?
Ask Aica to explain any part of this differently. Free, takes 30 seconds.
Key terms
- Iterative testing
- Testing carried out during development, where each component or subroutine is tested as soon as it is written before moving on.
- Final testing
- Testing carried out on the complete finished program to verify that all components integrate correctly; also called terminal testing.
- Syntax error
- An error where code breaks the grammatical rules of the programming language; the translator cannot parse it and the program will not run.
- Logic error
- An error where the program runs without crashing but produces incorrect or unexpected output because the logic is wrong.
- Normal test data
- Valid input data well within the acceptable range that the program should accept and process correctly.
- Boundary test data
- Valid input data at the exact edges of the acceptable range, used to catch off-by-one errors in conditions.
- Invalid test data
- Data of the correct type but outside the acceptable range; the program should reject it. For example, -1 for an age field.
- Erroneous test data
- Data of the completely wrong type; the program should reject it without crashing. For example, "hello" entered for an age field.
- Test plan
- A document listing the inputs to be tested, the expected results, and the actual results, providing evidence that systematic testing was carried out.
Frequently asked questions
A syntax error breaks the grammatical rules of the programming language so the program will not run at all - the translator reports it. A logic error allows the program to run but produces wrong output because the logic is incorrect, and it can only be found by testing.
Normal data checks the program handles typical valid inputs. Boundary data checks the exact limits where off-by-one errors appear. Invalid data (correct type, wrong range) checks rejection of out-of-range values. Erroneous data (wrong type entirely) checks the program does not crash on unexpected input types.
Iterative testing tests each subroutine or component during development as soon as it is written, catching bugs early when they are cheapest to fix. Final (terminal) testing tests the complete integrated program at the end to check all components work together correctly.
Generate revision on any topic you study
Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.
Lessons on anything
Structured, level-matched lessons on any topic you study
Practice quizzes
Find out what you actually know before the exam does
Flashcard sets
Lock in key concepts with instant revision cards
Ask Aica
Stuck on something? Get a clear explanation, any time
Defensive Design
Boolean Logic
Related lessons
7 min
8 min
9 min