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 · Finding the edges

Where exactly are the edges?

An age check should accept any whole number from 0 to 120, and "from 0 to 120" includes both 0 and 120. Drag each tag to the age it describes, then check. Careful: the four tags come in two tight pairs.

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.

7 of 7 still to sort.

Same age check: whole numbers from 0 to 120. Sort each test value, then read why it belongs there.

Watch out: 121 and 500 should both be rejected, but they test different things. Being rejected doesn't make a value erroneous.

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 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 it's accepted. Expected and actual match.

1 / 6

Work out the expected outcome from the rule first. Never copy it from what the program did.

Step 1 of 6: Normal data. 30 >= 0 is true and 30 < 120 is true, so it's accepted. Expected and actual match..

Watch out: 121 was rejected correctly, so its test passed. Only 120 exposed the bug. That's why you test both sides of each limit.

Testing · Is that enough?

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?

Testing · Build a test plan

Your turn: plan the tests

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. Rule: a whole number from 1 to 10. The limits are 1 and 10, and both should be accepted.Always start here. You can't aim at the edges until you know where they are.
  2. missing step
Which line is step 2?

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

1Work out the expected outcome before the test, then compare it with the actual outcome; a mismatch shows an error to fix.
2Suitable test data covers different kinds of input, so correct behaviour and the handling of invalid input are both checked.
3Normal data: valid, typical values the program should accept and process correctly.
4Boundary data: the smallest and largest accepted values and the values just outside them. Test both sides of every limit.
5Erroneous data: the wrong data type or clearly outside the range. A robust program rejects it without crashing.
6In a test plan, every value gets its type, the reason it was chosen and its 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

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?
The input values you choose to run a program with when you test it.
When do you work out a test's expected outcome?
Before you run the test, from what the program is supposed to do. Never copy it from what the program actually did.
What does a mismatch between actual and expected outcome tell you?
There's an error in the program to fix.
Why isn't testing only with values that should work enough?
Those values never check the edges of the range or how invalid input is handled.
What is normal test data?
Valid, typical data that the program should accept and process correctly.
Which four values make up the boundary test data for a range?
The smallest and largest values that should be accepted, and the values just outside each of them, which should be rejected.
What two kinds of input count as erroneous test data?
Data of the wrong data type, and values clearly outside the valid range.
For a 0 to 120 age check, 121 and 500 are both rejected. Are they the same type of test data?
No. 121 is boundary data because it sits just past the upper limit. 500 is erroneous because it's clearly outside the range.
An age check uses age < 120 when it should use age <= 120. Which test value exposes it?
120. The program rejects it when it should accept it. 121 is still rejected correctly, so its test passes.
How should a robust program deal with erroneous data?
Reject it without crashing, for example by showing an error message and asking again.
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 write down for each value in a test plan?
Its type of test data, the reason you chose it, and its expected outcome.

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 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.