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.

Python
  1. def ticket_price(age):
  2. if age <= 16:
  3. price = 5
  4. else:
  5. price = 10
  6. return price
  7. print("Test 1: age 20, expected 10, got", ticket_price(20))
  8. print("Test 2: age 15, expected 5, got", ticket_price(15))
  9. 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 · The development cycle

Rebuild the loop, then break it

3 stages are missing. Use the rest of the loop to work out which goes where.

  1. Stage 1: Test

    Run the tests and compare each actual result with its expected result.

  2. Stage 3: Fix or improve

    Change the solution in response to an outcome.

  3. Stage 4: Record the change

    Note what was changed and which test prompted it.

…and stage 6 leads back to stage 1.

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.

8 of 8 still to sort.

Computer Science · Deciding what comes first

Three results, one to-do list

Which should the developer deal with first?

1 · Deal with first3 · Deal with last
  1. All tests pass, but the prompt "Enter n:" is unclear.

  2. A test shows the requirement to save scores has not been met.

  3. The program stops part-way through, so the solution does not work.

Computer Science · What do you think?

Which of these sounds like you?

A student runs all of the tests on their quiz program. Most tests pass and two fail.

Which idea is closest to what you would do next?
How sure are you?

Computer Science · Write it up

Say it in your own words

A developer has run all the tests on a program and one test has failed. Explain how the developer should use the testing outcomes to inform further development. [7 marks]

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

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

1A test outcome is pass (actual matches expected) or fail (it doesn't), and the outcomes decide what to fix, change or improve next.
2A failed test's data, expected result and actual result help you find the code that caused the error.
3Outcomes can show syntax, logic and run-time errors, unmet requirements, mishandled invalid or boundary data, and improvements for the user.
4Failures that stop the solution working or stop a requirement being met are dealt with first.
5After a change: retest the failed test, regression test the earlier passes, and record the change against the test that prompted it.

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?
The result of running a test: the actual result matched the expected result (pass) or didn't (fail).
What are testing outcomes used for?
To inform further development: they show what needs to be fixed, changed or improved next.
What does a failed test show, and which details help locate the cause?
That the solution contains an error that must be found and fixed. The test data, expected result and actual result help locate the code that caused it.
Syntax error
Code that breaks the rules of the programming language, so it won't run. Correct it before the program can be tested further.
Logic error
The program runs but produces an incorrect result or behaves in an unintended way. Fixed by changing the code so it produces the expected result.
Run-time error
The program stops or crashes while running, for example on unexpected input. Fixed by changing the code so the solution handles that situation.
An outcome shows a requirement is not met or only partly met. What happens?
The solution must be changed or extended to meet it.
An outcome shows invalid or extreme (boundary) data isn't handled correctly. What happens?
The developer adds or improves the handling of that data, for example with validation.
Can outcomes show improvements when every test passes?
Yes. They can show things that would make the solution better for the user, such as clearer prompts, output or error messages.
Which failures does the developer deal with first?
Those that stop the solution working or stop a requirement being met.
Retesting
After a change, running the test that failed again to check the change fixed the problem and the actual result now matches the expected result.
Regression testing
After a change, running earlier tests that passed again to check the change hasn't introduced a new error into parts that previously worked.
Why record each change, linked to the test that prompted it?
So the reason for the change and the result of retesting can be shown.
When does the test, review, fix or improve, test again cycle stop?
When the solution meets its requirements.

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.