GCSE · Computer Science · Eduqas · Spec C500QS

Explaining test outcomes

Your program just passed its test. High-five? Hold on a second. A test result is evidence, and a good tester knows exactly what it proves and what it does not.

Computer Science · Testing

Be the tester: run the age checker four ways

The rule: accept ages 11 to 16, reject everything else.

This program checks an age against the rule. Pick a test, then call what it prints before the table shows it. Nothing is run: every value here is the lesson’s.

age = input("Enter an age: ")
if age >= 11 AND age < 16 then
print("Accepted")
else
print("Rejected")
endif

Variables

age=14

Step 1. The tester types in 14. This first step is worked for you.

Step 1 of 4Called right: 0 of 2

Work the condition out by hand. Both halves must be true for the if part to run.

Computer Science · Testing

Priya’s test passed. So what can she say?

Priya tests her age checker with one normal age, 14. The actual result matches the expected result.

Which is closest to what you think she can say?
How sure are you?

Exam line: A pass is evidence about the data tried, not a guarantee about every input.

Computer Science · Testing

Which way does the outcome go?

A test has been run. Choose a branch at each fork to see where an explanation ends up.

Compare the results → Check the test → Look at the run

4 possible explanations.

On A test has been run. 2 branches to choose from.

Exam line: Match: requirement met for this data. Differ: check the test first, then name a runtime error or a logic error.

Computer Science · Testing

Two ways a program can go wrong

This program should share a bill of 60 and a tip of 12 equally between 4 people, so the test expects it to print 18.0. Press Run, read what happens, then choose a fix for the line that needs changing.

Python
  1. bill = 60
  2. tip = 12
  3. people = 0
  4. each = bill + tip / people
  5. print(each)

The messages and outputs are what Python 3.13 gives for this exact code. Other languages word their messages differently.

Computer Science · Testing

Find the first row that goes wrong

Delivery is meant to be free for a basket total of 30 or more. The program has: if total > 30 then postage = 0, else postage = 3.50, then prints postage. The boundary test with total 30 expects 0 but printed 3.5. Here is a hand trace of that test. Pick the first row where the values stop matching what the rule intends.

A student’s trace table — which line goes wrong?

Exam line: Trace by hand with the test data. The cause is at the first line where the values differ from what was intended.

Computer Science · Testing

Write the full explanation

A ticket program contains the line: n = int(input("Tickets: ")). Erroneous data test: the tester types the text abc. Expected result: the message "Please enter a number". Actual result: the program stops and shows ValueError: invalid literal for int() with base 10: 'abc' against that line.

Explain this test outcome. [3 marks]

0 words · your answer stays on this page and is not sent anywhere.

Exam line: Three parts: link to the requirement, say whether it is met, name the likely cause.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

What a test result really tells you, and how to find out why it went wrong.

What you need to know

  • A test outcome is the actual result you get when you run a test.
  • Start explaining it with one comparison: does the actual result match the expected result, or differ? A difference means something is wrong, and you must say why.
  • A match shows the program behaves as required for that test data, so the requirement linked to the test is met for that case.
  • A pass shows only that the program works for the data tried. Untested inputs may still give wrong results.
  • Have a goYour friend’s program passed three tests, all with ages from 20 to 30. They shout, “Zero bugs, ship it!” Does that show it handles an age of -5? Say why.

    No. It only shows the program works for the ages that were tried.

    A passed test says nothing about inputs that were never tested, so -5 could still go wrong.

  • If the results differ, check the test itself before blaming the code: the expected result or the data entered may be wrong.
  • A logic error runs to the end but gives the wrong result. A runtime error stops the program while it is running.
  • Have a goA program prints 7.5 and finishes with no error message, but the test expected 9. Logic error or runtime error?

    A logic error.

    It ran all the way to the end and gave the wrong result. A runtime error would have stopped the program part-way.

  • Normal data is typical, valid input. Its outcome shows whether the program processes the input it expects to receive.
  • Boundary data sits at the edges of the allowed range. A wrong result there often points to < used where <= was needed, or the reverse.
  • Have a goA password may be at most 12 characters. A test with exactly 12 characters is rejected. Is the code more likely to use < 12 or <= 12?

    < 12. It should have been <= 12.

    Exactly 12 sits on the edge of the allowed range, and a wrong result at an edge often points to < used where <= was needed.

  • Erroneous data is invalid input. If it is accepted or crashes the program, validation is missing or incorrect.
  • To find the cause, trace the code by hand with the test data and spot the line where values first differ from what was intended.

The big picture

A test outcome is the actual result of running a test. Compare it with the expected result: a match shows the requirement is met for that data only, and a difference means something is wrong. Check the test itself, then name the cause, such as a logic error or a runtime error, and trace the code by hand to find where it starts.

Key points

1Compare first: actual result against expected result. They match or they differ.
2A match means the requirement is met for that test data. A pass never proves there are no errors.
3When results differ, check the test itself first, then decide between a runtime error (stopped) and a logic error (finished, wrong result).
4Normal, boundary and erroneous data each show something different. A boundary failure often points to < used where <= was needed.
5A full explanation links the result to the requirement, says whether it is met, and names the likely cause in the code.

Worked example

Problem

A shop program should give a discount to anyone aged 65 or over. A boundary test uses the age 65. The test plan expects the message Discount, and the program prints Discount. Explain this test outcome.

⚠ Watch out

Treating a pass as proof there are no errors, and treating every unexpected result as a code mistake. A pass shows only that the program works for the data tried. A mismatch means checking the test itself before blaming the code.

🧠

Memory hook

ACT: Actual versus expected, Check the test, Trace the code.

✓

Check yourself

A boundary test expects Accepted but the program prints Rejected, and the test turns out to be set up correctly. In two sentences, say what this shows and what you would do next.

Flashcards

(12)
What is a test outcome?
The actual result produced when a test is run. Explaining it means saying what that result shows about whether the program works correctly for the data used.
What is the first step in explaining a test outcome?
Compare the actual result with the expected result. They either match or they differ.
What does a match between actual and expected result show?
The program behaves as required for that test data, so the requirement linked to the test is met for that case.
Why does a passed test not prove a program is error-free?
It shows only that the program works for the data tried. Untested inputs may still produce wrong results.
A test result differs from the expected result. What must your explanation do?
Say why the unexpected result happened, because a difference shows that something is wrong.
What is a logic error?
The program runs but gives the wrong result because of a mistake in the code.
What is a runtime error?
The program stops while it is running, for example when it divides by zero or converts text that is not a number into a number.
What should you check before blaming the code?
The test itself: the expected result may have been worked out wrongly, or the data may have been entered incorrectly.
What does a normal data test show?
Whether the program correctly processes the kind of input it is expected to receive.
What does a boundary data test show?
Whether the program handles the limits of the allowed range correctly. A wrong result often points to < used where <= was needed, or the reverse.
What does an erroneous data test show?
Whether the program rejects input it should not accept. Invalid data that is accepted or crashes the program shows validation is missing or incorrect.
How do you find the line that causes an unexpected result?
Trace the code by hand with the test data, for example in a trace table, and find the line where the values first differ from what was intended.

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 Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)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 16 November 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.