GCSE · Computer Science · Eduqas · Spec C500QS
Using testing outcomes to inform development
Your program just failed a test. Panic? No. That failed test is the most helpful thing a developer can get: it tells you where to start looking.
Computer Science · Testing outcomes
One failed test, one fix, one nasty surprise
A ticket machine charges £5 to anyone under 16 and £10 to everyone else. Three tests were written for ticket_price. Press Run, read each test's data, expected result and actual result, then choose the fix for the line you think is responsible. Try several fixes and compare all three tests every time.
- def ticket_price(age):
- if age <= 16:
- price = 5
- else:
- price = 10
- return price
- print("Test 1: age 20, expected 10, got", ticket_price(20))
- print("Test 2: age 15, expected 5, got", ticket_price(15))
- print("Test 3: age 16, expected 10, got", ticket_price(16))
Every result shown is what Python 3 prints for this exact code.
Computer Science · What an outcome shows
What is this test result telling you?
Each description is one testing outcome. What does it show, and what change does that call for?
Still to sort
Syntax error (0)
Code that breaks the rules of the language, so it will not run.
Where the line is: The program never gets going at all. A logic error or run-time error means it does run.
Logic error (0)
The program runs but gives an incorrect result or behaves in an unintended way.
Where the line is: It carries on to the end, but the answer is wrong. A run-time error is when it stops or crashes.
Run-time error (0)
The program stops or crashes while it is running.
Where the line is: It started fine and then stopped. A syntax error stops it before it can run.
Requirement not met (0)
A requirement is missing or only partly met.
Where the line is: Nothing is crashing or miscalculating. A feature the solution is supposed to have is not there, or only half there.
Invalid or boundary data mishandled (0)
Unsuitable or extreme data is not dealt with correctly.
Where the line is: The program copes with normal data. It is the odd or extreme data it fails to deal with properly.
User improvement (tests pass) (0)
The tests pass, but something could be better for the user.
Where the line is: Nothing has failed. The solution works but could be clearer or easier to use.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
A test result isn't a verdict on your program. It's your next instruction.
What you need to know
- A testing outcome is the result of a test: the actual result either matches the expected result (a pass) or it doesn't (a fail).
- Outcomes aren't a verdict. They tell the developer what needs to be fixed, changed or improved next.
- A fail shows an error that must be found and fixed. Its test data, expected result and actual result help locate the code at fault.
Have a goYour classmate's test fails and they groan, "That's it, the whole program is rubbish, I'm starting again." What would you tell them to look at instead?
The failed test's test data, expected result and actual result, to find the code that caused the error and fix it.
A fail shows an error that can be located and fixed. It isn't a verdict on the whole program.
- A syntax error breaks the rules of the programming language, so the program won't run. Correct it before testing can go further.
- A logic error runs but gives a wrong result. A run-time error stops or crashes the program while it runs, for example on unexpected input.
Have a goA program runs all the way to the end with no crash and no message, but prints 7 where the test expected 9. Which kind of error is that?
A logic error.
It runs but gives an incorrect result. A run-time error would have stopped or crashed the program while it was running.
- Outcomes can also show a requirement is not met or only partly met, or that invalid or extreme (boundary) data isn't handled correctly, for example needing validation.
- Even when every test passes, outcomes can show improvements for the user, such as clearer prompts, output or error messages.
- The order matters: deal first with failures that stop the solution working or stop a requirement being met.
- After a change, rerun the failed test (retesting). Also rerun earlier passing tests (regression testing) to check nothing new broke.
Have a goYou fix a bug and the test that failed now passes. Before you trust the fix, what else should you run?
The earlier tests that passed (regression testing).
Retesting only shows the fix worked on the failed test. Rerunning the passing tests checks the change hasn't introduced a new error elsewhere.
- It's a cycle: test, review, fix or improve, test again, until the requirements are met. Record each change, linked to the test that prompted it.
The big picture
Testing outcomes decide what a developer does next: fix errors, meet requirements, handle awkward data or improve things for the user. Every change is then tested again, both the failed test and the earlier passes, and the cycle repeats until the requirements are met.
Key points
Worked example
Problem
A developer tests a function divide(a, b). Test 1: divide(8, 2) expected 4.0, actual 4.0. Test 2: divide(9, 3) expected 3.0, actual 3.0. Test 3: divide(5, 0) expected "Cannot divide by zero", but the program stops with ZeroDivisionError. Show how the developer uses these outcomes.
⚠ Watch out
Believing the job is finished once the failed test passes. A fix is only trusted after the failed test has been rerun and the earlier passing tests have been rerun too, because the change might have broken something that used to work.
Memory hook
Fail, find, fix, record, then rerun twice: the test that failed and the tests that passed.
Check yourself
A developer changes one line, sees the failed test pass and ships the program. Name the check they skipped, say what it looks for, and say what they forgot to write down.
Flashcards
(14)What is a testing outcome?
What are testing outcomes used for?
What does a failed test show, and which details help locate the cause?
Syntax error
Logic error
Run-time error
An outcome shows a requirement is not met or only partly met. What happens?
An outcome shows invalid or extreme (boundary) data isn't handled correctly. What happens?
Can outcomes show improvements when every test passes?
Which failures does the developer deal with first?
Retesting
Regression testing
Why record each change, linked to the test that prompted it?
When does the test, review, fix or improve, test again cycle stop?
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 Eduqas GCSE Computer Science topics
- Presenting test outcomes with commentary
- Program a solution to requirements
- Refining code during development
- Selection in programs
- Sequence in programs
- String manipulation in code
- Subroutines with well-defined interfaces
- Typical, extreme and erroneous test data
- Understanding revised requirements
- Using a variety of data types
- Validation and verification routines in code
- Variables, operators, inputs, outputs and assignment
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.