Testing programs: test plans and test data

A program is only finished when you have shown it works. A test plan lists what you will test, the data you will use and what should happen, before you run anything.

Practise this lesson free (7 questions)

Three kinds of test data

For an input that must be a whole number from 0 to 100:
Normal data: typical valid values that should be accepted, such as 55.
Boundary data: values at the very edge of the valid range, such as 0 and 100. Programs often fail here, for example by using < instead of <=.
Erroneous data: values that should be rejected, such as "abc", 150 or -5.

A test plan

Each row has a test number, what is being tested, the test data, the expected result (worked out before running) and, after running, the actual result. If they differ, the program is fixed and tested again.
def grade(mark):
if mark >= 70:
return "Distinction"
elif mark >= 40:
return "Pass"
else:
return "Fail"
TestPurposeDataExpected result
1Normal pass mark55Pass
2Boundary: lowest pass40Pass
3Boundary: highest fail39Fail
4Boundary: lowest distinction70Distinction
5Erroneous: not a number"abc"Rejected with a message

Testing validation

This loop rejects anything that is not all digits or is above 100:
mark = input("Mark: ")
while not mark.isdigit() or int(mark) > 100:
mark = input("Whole number 0 to 100: ")
mark = int(mark)
print("Accepted", mark)
With the inputs abc, 150, -5 and 72, it asks again three times, then prints: Accepted 72
"-5" is rejected because the minus sign is not a digit, so isdigit() is False.

Fitness for purpose and efficiency

Fit for purpose: it does everything the requirements ask, gives correct results for all the test data and handles bad input without crashing.
Efficient: it does not repeat work. For example, it stops a search once the item is found, uses a loop instead of copied lines, and does a calculation once after a loop rather than every time round it.
When asked to evaluate a program, say what works, what does not, and suggest a specific improvement.
Worked example

A program accepts a number of tickets from 1 to 6. Give one example each of normal, boundary and erroneous test data.

  1. Normal: a typical valid value, such as 3.
  2. Boundary: the edge of the range, 1 or 6.
  3. Erroneous: a value that must be rejected, such as 7, 0 or "two".

Answer: Normal 3, boundary 6, erroneous 7

Key idea

Test with normal, boundary and erroneous data. A test plan gives the purpose, data and expected result for each test, then records the actual result. Evaluate a program on correctness, robustness and efficiency.

Key words
Erroneous data
Invalid test data that should be rejected.
Normal data
Typical valid test data that should be accepted.
Boundary data
Valid test data at the very edge of the allowed range.

All GCSE and International GCSE Computer Science key terms and definitions →

Quick check

Try two quick questions

See if it has sunk in. Answers are marked straight away.

Extra practice

2 more questions

Try each one, then tap to check.

  1. A program accepts years from 2000 to 2025. Which is boundary test data?

    1. 2012
    2. 1990
    3. 2000
    4. "twenty"
    Show the answer

    Answer: 2000

    2000 is valid and at the edge.

  2. A program accepts years from 2000 to 2025. Which is erroneous test data?

    1. 2000
    2. 2025
    3. 2030
    4. 2012
    Show the answer

    Answer: 2030

    2030 is outside the range.

Check you have got it

Answer 7 quick questions with instant marking. If you get one wrong, GCSE-ready shows you why and gives you another go. It is free, and you do not need an account.

Video for this lesson coming soon. Subscribe on YouTube

Sources and references

Checked by the GCSE-ready editorial team, 17 October 2026. Last updated 2 October 2026. Spotted a mistake? Tell us and we will fix it.

What do exam command words like explain and evaluate mean? →

Related lessons