Cambridge AS Level Computer Science 9618 · 12.3 Program Testing and Maintenance

Q35 · 9618/21/O/N/21 Q4

Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.

Q359618/21/O/N/21original Q4Structured · 7 marks
Question 4 from 9618/21/O/N/21

Worked solution

(a)

Valid values are 0 to 40. Test the two edges (boundary data) and one value just outside each edge (abnormal data).

TestTest data valueExplanationExpected outcome
123Normal dataData is accepted
20Boundary dataData is accepted
340Boundary dataData is accepted
441 (or any value above 40)Abnormal dataData is rejected
5-1 (or any value below 0)Abnormal dataData is rejected

Test 2 row correct [1]

Test 3 row correct [1]

Test 4 row correct [1]

Test 5 row correct [1]

(b)

Label the four arrows:

Arrow from Heaters Off to Heaters On: Temp < 10 [1]

Arrow from Heaters On to Heaters Off: Temp > 20 [1]

Loop on each state, with a condition that is the opposite of the leaving arrow: Heaters Off loop Temp >= 10, Heaters On loop Temp <= 20 [1]

KEY IDEATest data for a range needs normal, boundary and abnormal values; each state needs an arrow for every possible input.
TOTAL 7 marks

Official mark scheme

Mark scheme for 9618/21/O/N/21 question 4
VIDEO
▶ Whole paper

Video solution of the whole paper · by Mr Saem. 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.