9618/21/O/N/21 question 4: worked solution (October/November 2021, paper 21)

Show as plain text

Cambridge AS Level Computer Science 9618 · 12.3 Program Testing and Maintenance Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3. Q35 9618/21/O/N/21 original Q4 Structured · 7 marks Worked solution (a) Valid values are 0 to 40. Test the two edges (boundary data) and one value just outside each edge (abnormal data). Test Test data value Explanation Expected outcome 1 23 Normal data Data is accepted 2 0 Boundary data Data is accepted 3 40 Boundary data Data is accepted 4 41 (or any value above 40) Abnormal data Data is rejected 5 -1 (or any value below 0) Abnormal data Data 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 IDEA Test 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 VIDEO ▶ Whole paper Video solution of the whole paper · by Mr Saem. Tap the picture to open it on YouTube.