9618/21/O/N/25 question 1: worked solution (October/November 2025, 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. Q57 9618/21/O/N/25 original Q1 Structured · 10 marks Worked solution (a) Use the insert's operators and functions. & joins strings, MID takes part of a string, NUM_TO_STR turns a number into a string, LENGTH gives the number of characters and INT makes a whole number. Expression MyString ← 'X' & MyString MyChar ← MID("ABCD", 1, 1) MyString ← NUM_TO_STR(DAY(MyDOB)) MyInt ← INT(LENGTH(MyString) / 2) Row 1: & [1] Row 2: MID with a start position 1, 2, 3 or 4 and length 1 [1] Row 3: NUM_TO_STR with DAY, MONTH, YEAR or DAYINDEX [1] Row 4: INT and LENGTH [1] (b) Test description Test method carried out as soon as a program module has been coded alpha carried out as program modules are being combined integration completed by the developers without referring to the code black-box completed by the customer acceptance (or beta) Integration [1] Black-box [1] Acceptance (or beta) [1] (c) Name two features and say what each does: A breakpoint stops the program at a chosen line or statement, so the variables can be looked at in the report window [1] Single stepping runs one line or statement at a time, so the report window shows how the variables change after each line [1] Explanation of both: one stops the program at a chosen line, the other runs one line at a time, to locate the error [1] KEY IDEA A breakpoint stops the program at a chosen place and single stepping moves on one line at a time, so the report window shows exactly where a value goes wrong. TOTAL 10 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by CSFeedbySirNisarAli. Tap the picture to open it on YouTube.