Skip to main content
EnglandComputer ScienceSyllabus dot point

Why do we test programs, what kinds of testing are there, and what test data should you use?

The purpose of testing, the difference between iterative and terminal (final) testing, and the types of test data (normal, boundary and erroneous or invalid), with how to choose suitable test data.

An OCR J277 2.3.2 answer on testing: the purpose of testing, iterative versus terminal (final) testing, and the three types of test data (normal, boundary and erroneous or invalid), with how to choose suitable test data and build a test plan.

Generated by Claude Opus 4.810 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The purpose of testing
  3. Iterative and terminal testing
  4. Types of test data
  5. Try this

What this dot point is asking

OCR wants you to explain the purpose of testing, the difference between iterative and terminal (final) testing, and the three types of test data: normal, boundary and erroneous (invalid). You must be able to choose suitable test data for a program and say what each type checks. This is examined in Paper 2, often as a short test plan or a "give an example of each" question.

The purpose of testing

Iterative and terminal testing

Types of test data

A test plan is usually a table:

Test data Type Expected result
"sunflower9" Normal Accepted
6 characters Boundary Accepted
5 characters Boundary Rejected
blank Erroneous Rejected

Try this

Q1. State the purpose of testing a program. [1 mark]

  • Cue. To find and remove errors and check the program works correctly, meets its requirements and handles invalid input.

Q2. For a program accepting a number from 1 to 50, give one example each of normal, boundary and erroneous test data. [3 marks]

  • Cue. Normal: 25. Boundary: 1 or 50 (or 0 / 51 just outside). Erroneous: 100, or a letter.

Q3. State when iterative testing is carried out. [1 mark]

  • Cue. Repeatedly during development, as each part of the program is written.

Exam-style practice questions

Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

OCR 20214 marksA program accepts a test mark from 0 to 100. Give one example each of normal, boundary and erroneous test data for this program, and explain what boundary test data checks.
Show worked answer →

Normal (valid) data (1): a typical value the program should accept, for example 57.

Boundary data (1): a value at the edge of what is allowed, for example 0 or 100 (and just outside, such as -1 or 101). The example 100 is on the boundary.

Erroneous (invalid) data (1): data the program should reject, for example 150, -5, or a letter such as "x".

What boundary data checks (1): it checks that the program behaves correctly right at the limits of the acceptable range, where off-by-one errors are most likely (for example accepting 100 but rejecting 101).

Markers reward one correct example of each type and a clear statement that boundary data tests behaviour at the edges of the valid range.

OCR 20224 marksExplain the difference between iterative testing and terminal (final) testing, and state why testing a program is important.
Show worked answer →

Iterative testing (up to 2): testing that is carried out repeatedly during development, as each part of the program is written, so errors are found and fixed early while the code is being built.

Terminal (final) testing (up to 2): testing carried out at the end, on the completed program, to check that the whole program works as a finished product and meets the requirements.

Why testing matters (within the marks): to find and remove errors, to check the program meets its requirements and produces correct results, and to make sure it handles invalid input without crashing.

Markers reward the during-development versus at-the-end distinction and a clear purpose for testing. Saying "iterative is better" misses that they happen at different stages.

Related dot points

Sources & how we know this