GCSE · Computer Science · AQA · Spec 8525
Selecting suitable test data
An age check accepts 30, rejects 500, looks perfect… and still turns away everyone aged exactly 120. The bug is one character. Here's where to aim.
Testing · Types of test data
Name the type
Which type of test data is each value?
Still to sort
Normal (0)
Valid, typical data the program should accept and process correctly.
Where the line is: Normal data is comfortably inside the range. A valid value sitting right on a limit is boundary data instead.
Boundary (0)
On an edge of the valid range, or the first value just outside it.
Where the line is: A value one step past a limit is rejected, but it's boundary data: it checks the edge is in exactly the right place.
Erroneous (0)
Invalid data the program should reject: the wrong data type, or clearly outside the range.
Where the line is: Erroneous data isn't hugging an edge. It's clearly outside the range, or not a number at all.
Same age check: whole numbers from 0 to 120. Sort each test value, then read why it belongs there.
Testing · Expected vs actual
One wrong symbol, caught at the edge
This age check was written with < where it needed <=. Each row is one test: the value typed in, the outcome worked out beforehand, and what the program actually did.
Before each step, decide: should this age be accepted? Then step on 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 it's accepted. Expected and actual match.
Work out the expected outcome from the rule first. Never copy it from what the program did.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Aim at the middle, the fences and the clearly wrong: normal, boundary and erroneous data, each with its expected outcome.
What you need to know
- Testing means running a program with chosen inputs, called test data, and checking what it actually does.
- Before running a test, work out the expected outcome. Then compare it with the actual outcome.
- If actual and expected don't match, you've found an error to fix.
Have a goYour mate's quiz app should accept a score of 75 out of 100. It says 'Rejected'. They shrug: "Must be a dodgy test value." Are they right?
No. The program has an error to fix.
Expected 'accepted', got 'rejected': that mismatch points at the program. 75 is a perfectly valid score, so blaming the test value misses the bug.
- Values that should work aren't enough on their own: you also need to check how invalid input is handled.
- Normal data is valid, typical input the program should accept, like an age of 30 for a 0 to 120 check.
- Boundary data sits at the edges: the smallest and largest values accepted, plus the values just outside them.
Have a goA youth club takes whole-number ages from 11 to 18. Name its four boundary test values.
10, 11, 18 and 19.
11 and 18 are the last ages let in; 10 and 19 are the first turned away. Picking 12 and 17 stays inside and never tests where the edges are.
- Edges are where errors love to hide, for example writing < where <= was needed.
- Erroneous data is invalid: the wrong data type, like the text 'ten', or clearly out of range, like 500.
Have a goSomeone types the word 'eleven' into that 11-to-18 club form and calls it boundary data, because eleven is on the edge. What's gone wrong?
'eleven' is text, the wrong data type, so it's erroneous.
What counts is what's typed, not what the word means. Boundary data are numbers at the edges, like 10 and 11.
- A robust program rejects erroneous data without crashing, for example by showing an error message and asking again.
- For a test plan, find the rule, then give every value its type, the reason you chose it and its expected outcome.
The big picture
Testing runs a program with chosen inputs (test data) and compares the actual output with the expected output worked out beforehand; a mismatch means an error to fix. Suitable test data checks both correct behaviour and invalid input: normal data (valid, typical), boundary data (the smallest and largest accepted values and the values just outside them, where slips like < for <= hide) and erroneous data (wrong type or clearly out of range, rejected without crashing). For each value, give its type, why you chose it and its expected outcome.
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
Calling every rejected value erroneous: for a 0 to 120 check, 121 is rejected but it's boundary data, while 500 and 'ten' are erroneous. And testing only one side of a limit: 120 catches a mistaken <, 121 checks rejection just outside, so test both.
Memory hook
Middle, fence, far away. One normal value from the middle, both sides of every fence, something clearly wrong, and predict every result before you press run.
Check yourself
A quiz app accepts whole-number scores from 0 to 50. Give one normal value, the four boundary values and two different erroneous values, each with its type and expected outcome.
Flashcards
(12)What is test data?
When do you work out a test's expected outcome?
What does a mismatch between actual and expected outcome tell you?
Why isn't testing only with values that should work enough?
What is normal test data?
Which four values make up the boundary test data for a range?
What two kinds of input count as erroneous test data?
For a 0 to 120 age check, 121 and 500 are both rejected. Are they the same type of test data?
An age check uses age < 120 when it should use age <= 120. Which test value exposes it?
How should a robust program deal with erroneous data?
What's the first step when choosing test data for an input check?
What should you write down 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 28 October 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.