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.

Find the fences

Where exactly are the edges?

A program asks for an age and should accept any whole number from 0 to 120. Think of 0 and 120 as two fences. Drag each tag to the value it describes. Start with N as a warm-up, then take care with A to D, because being exactly right is the whole point.

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.

6 of 6 still to sort.

Watch out: 121 and 500 should both be rejected, but they test different things. 121 checks the upper edge is in exactly the right place. 500 checks the program copes with something clearly wrong.

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 age
2 IF age >= 0 AND age < 120 THEN
3 OUTPUT "Accepted"
4 ELSE
5 OUTPUT "Rejected"
6 ENDIF
ageexpectedactualmatch?
30AcceptedAcceptedyes

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.

1 / 6

Predict each row before you press Next: accepted or rejected?

Step 1 of 6: Normal data. 30 >= 0 is true and 30 < 120 is true, so the program accepts it. Expected and actual match..

Watch out: Only 120 caught this bug. The value just outside, 121, was rejected correctly, so the test at 121 passed. That's why you test both sides of each fence: the last value in and the first value out.

What do you think?

Has Sam tested it properly?

Sam tests the age check (whole numbers from 0 to 120) by typing in 25, 40 and 67. The program accepts all three. Sam says: 'Tested. It works.'

Which is closest to what you think right now?
How sure are you?

Your turn, with a safety net

Build a test plan

A cinema website asks how many tickets you want: a whole number from 1 to 10. Build a test plan, giving each value's type, why it was chosen and the expected outcome.

  1. Find the rule and its limits: 1 to 10, so the fences are at 1 and 10.Always start here. You can't aim at the edges until you know where they are.
  2. Normal: 4. An ordinary booking, nowhere near a fence. Expected: accepted.
  3. missing step
Which line is step 3?

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

1Testing means running a program with chosen inputs (test data) and comparing the actual output with the expected output, worked out beforehand. A mismatch shows there's an error to fix.
2Testing only with values that should work isn't enough. Suitable test data checks correct behaviour AND how invalid input is handled.
3Normal data: valid values the program should accept and process, such as 30 for an age from 0 to 120.
4Boundary data: the smallest and largest values that should be accepted, plus the values just outside them that should be rejected. For 0 to 120, that's 0 and 120 (accepted) and −1 and 121 (rejected).
5Erroneous data: invalid data the program should reject, such as the text 'ten' or the value 500 for that age. A robust program rejects it without crashing, for example by showing an error message and asking again.
6To choose test data: find the rule's limits, then pick at least one normal value, the values on each side of every limit, and erroneous values. For each, state its type, why you chose it and the expected outcome.

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?
The input values chosen to run a program with when you test it.
How does a test show that a program has an error?
The actual output doesn't match the expected output that you worked out beforehand.
Why isn't testing only with values that should work enough?
It never checks the edges of the range or how invalid input is handled, so errors there go unnoticed.
What is normal test data?
Valid data that the program should accept and process correctly.
What is boundary test data?
Data at the edges of the valid range: the smallest and largest values that should be accepted, and the values just outside them that should be rejected.
What is erroneous test data?
Invalid data the program should reject, such as the wrong data type or a value clearly outside the range.
Why is the text 'ten' erroneous rather than boundary data for an age check?
It's the wrong data type, not a number at all, so it's invalid. It doesn't sit at an edge of the range.
How should a robust program deal with erroneous data?
Reject it without crashing, for example by showing an error message and asking again.
An age check uses age < 120 when it should use age <= 120. Which boundary value exposes it?
120. The program rejects it when it should accept it. 121 is still rejected correctly, so its test passes.
What's the first step when choosing test data for an input check?
Identify the valid range or rule, so you know exactly where the limits are.
What should you record for each value in a test plan?
Its type of test data, why you chose it, and the expected outcome (accepted, rejected or the expected output).

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 posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

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.