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

Q57 · 9618/21/O/N/25 Q1

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

Q579618/21/O/N/25original Q1Structured · 10 marks
Question 1 from 9618/21/O/N/25

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 descriptionTest method
carried out as soon as a program module has been codedalpha
carried out as program modules are being combinedintegration
completed by the developers without referring to the codeblack-box
completed by the customeracceptance (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 IDEAA 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

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

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