GCSE · Computer Science · AQA · Spec 8525
Selecting suitable test data
An age check can accept 30, reject 500, look perfect… and still turn away everyone aged exactly 120. The bug is one character. Here's where to aim your tests.
Normal, boundary or erroneous?
Sort the test data
Same age check: whole numbers from 0 to 120. Pick a value, then pick the kind of test data it is.
Still to sort
Normal (0)
Valid, and comfortably inside the range.
Where the line is: Normal values are inside the range but not on a limit. A value sitting right on a limit is boundary data.
Boundary (0)
Right at an edge: the last value in, or the first value out.
Where the line is: Boundary data is right at an edge, on either side of it. A value far outside the range is erroneous, not boundary.
Erroneous (0)
Clearly invalid: far outside the range, or the wrong type of data.
Where the line is: Erroneous data is clearly invalid. A value just one step outside a limit is boundary data instead.
Testing in action
One wrong symbol, caught at the fence
Each row is one test: the value typed in, the outcome worked out beforehand, and what the program actually did.
This age check was written with < where it needed <=. Before each step, decide whether the age should be accepted. Then press Next and compare.
1 INPUT age2 IF age >= 0 AND age < 120 THEN3 OUTPUT "Accepted"4 ELSE5 OUTPUT "Rejected"6 ENDIF
| age | expected | actual | match? |
|---|---|---|---|
| 30 | Accepted | Accepted | yes |
Output
30: Accepted
Step 1: Normal data. 30 >= 0 is true and 30 < 120 is true, so the program accepts it. Expected and actual match.
Predict each row before you press Next: accepted or rejected?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Why the edges of a range are where testing pays off, and how to choose a full set: normal, boundary and erroneous.
What you need to know
- What testing is: comparing a program's actual output with the expected output
- Why test data has to cover different kinds of input, not just values that should work
- What normal, boundary and erroneous test data are, with examples of each
- How to choose test data for an input check, giving each value's type, reason and expected outcome
The big picture
Testing means running a program with chosen inputs, called test data, and comparing what it actually does with the outcome you expected. A mismatch shows an error. Suitable test data covers three kinds of input. Normal data is valid and well inside the range. Boundary data sits at the edges: the smallest and largest values that should be accepted, and the values just outside them. Erroneous data is invalid, like the wrong data type or a value far outside the range, and should be rejected without a crash. Errors often hide at the edges, such as < written where <= was needed.
Key points
Worked example
Problem
A game asks for a difficulty level. The rule says the level must be a whole number greater than 0 and less than 6. Choose boundary test data for this rule and give the expected outcome of each value.
⚠ Watch out
Testing only one side of a fence. Choosing 121 but not 120 (or 120 but not 121) leaves half the edge untested. An age check written with < instead of <= rejects 121 correctly, so the only test that catches it is 120.
Memory hook
Middle, fence, far away. Normal data sits in the middle. Boundary data sits on each fence and one step past it. Erroneous data is far away, or not even a number.
Check yourself
Shoe sizes are whole numbers from 3 to 13. Write one normal, four boundary and two erroneous test values, marking each accepted or rejected. Check: 3 and 13 in, 2 and 14 out.
Flashcards
(11)What is test data?
How does a test show that a program has an error?
Why isn't testing only with values that should work enough?
What is normal test data?
What is boundary test data?
What is erroneous test data?
Why is the text 'ten' erroneous rather than boundary data for an age check?
How should a robust program deal with erroneous data?
An age check uses age < 120 when it should use age <= 120. Which boundary value exposes it?
What's the first step when choosing test data for an input check?
What should you record for each value in a test plan?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 30 September 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.