What you’ll work on
- Trace algorithms and use test cases to find and correct errors.
- Explain a method and check the reasonableness of a result.
Start with the idea
An algorithm needs clear inputs, ordered operations and outputs. A trace table records intermediate values so errors can be located.
Test normal cases, boundary cases and unusual valid inputs. A test that happens to work does not prove an algorithm is correct for every input.
A worked example
An area algorithm outputs length+width for a rectangle. Test 8 and 3, then fix it.
- The algorithm outputs 11.
- Rectangle area should 8×3=24; replace addition with multiplication.
Answer: Output length×width
Try one question
Trace: start n=5; n=n+3; n=2n. Find output.
Show answer and explanation
16
5→8→16.
Inside the collection
| Resource | Length | Practice | Answers |
|---|---|---|---|
| Learn and practise | 4 pages | 4 questions | Included |
| Apply and extend | 4 pages | 4 questions | Included |
| Topic checkpoint | 3 pages | 4 questions | Included |
Read on a device and work in an exercise book, or print the A4 PDFs. These files are not auto-marked digital quizzes.