Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 5 of 8.
Test data must be normal (in range), boundary (on the edge of the limit) or abnormal (outside the limit). Fill in the six empty boxes.
| Test data | Type of test data | Purpose of test data |
|---|---|---|
| 0 | normal | to make sure that the program accepts data that is in range |
| 100 (or –100) | boundary | to make sure that the program rejects data that is on the wrong side of the boundary |
| 300 | abnormal | to make sure that the program rejects data that is outside acceptable limits |
Row 1: type of test data is normal [1]
Row 1: purpose is to accept data that is in range [1]
Row 2: test data is 100 or –100 (just outside the limit) [1]
Row 2: purpose is to reject data on the wrong side of the boundary [1]
Row 3: test data is a value well outside the limits, for example 300 [1]
Row 3: type of test data is abnormal [1]
▶ Whole paper
Video solution of the whole paper · by MAK CS. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.