AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
Understand what is meant by testing in the context of algorithms and…
Full specification wording
Robust and secure programming: Understand what is meant by testing in the context of algorithms and programs.
Testing means running an algorithm or program with chosen inputs and checking that the outputs match what was intended, so faults can be found and fixed.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 4 of 14
Study notes
From the checked teaching notes for this specification point.
The idea
Testing means running an algorithm or program with chosen inputs and checking that the outputs match what was intended, so faults can be found and fixed. It is not the same as proving a program correct; it provides evidence that the code behaves as expected for the cases tried. Testers select data deliberately: normal data that should be accepted, boundary data at the edges of valid ranges, and erroneous data that should be rejected or handled. For example, a program accepting ages 0 to 120 might be tested with 30 (normal), 0 and 120 (boundary) and 150 or a letter (erroneous). Comparing actual output with expected output reveals defects, which are then corrected and retested. Testing applies to algorithms on paper as well as to running programs.
What earns the marks
- Testing is running an algorithm or program with chosen inputs and comparing actual outputs with expected outputs.
- Its purpose is to find faults or errors so they can be corrected, giving evidence of correct behaviour.
- Test data is chosen deliberately, including normal, boundary and erroneous values.
- Testing does not prove a program is completely correct; it only shows behaviour for the cases tested.
- Testing can be applied to algorithms (for example by tracing) as well as to running programs.
Common mistakes and how to put them right
Thinking testing proves a program is entirely correct.
Put it right: Testing only gives evidence for the cases tried, so it cannot guarantee freedom from all faults.
Believing testing is the same as debugging.
Put it right: Testing finds and reveals faults, while debugging is the process of locating and fixing them.
Using only one input, usually a typical value, and ignoring boundary and erroneous data that often expose faults.
Assuming testing only applies to finished programs.
Put it right: Algorithms can be tested by tracing them with sample data before any code is written.
Exam tips
- When asked what testing means, state both parts: running with chosen inputs and comparing actual with expected output.
- Link testing to its purpose, finding and fixing errors, rather than describing it as proving correctness.
- If asked to choose test data, classify each value as normal, boundary or erroneous and justify the choice.
- Remember algorithms can be tested by tracing, so do not restrict your answer to running code.
Try the lesson
The start of the Robust and secure programming: Understand what is meant by testing in the context of algorithms and programs. lesson, made from checked teaching notes for this specification point.
Have a go first
A programmer has written a program and now runs it with several sets of inputs to see whether it produces the expected outputs. What is this activity called?
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Robust and secure programming: Understand what is meant by testing in the context of algorithms and programs.
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge