Oxford Cambridge and RSA
GCSE (9-1) Computer Science
Algorithms & Programming
J277/02
Topic: Unit 2.3 Robust Programs (Test Plans & Data)
Time allowed: 45 minutes
Centre number Candidate number
First name Last name
INSTRUCTIONS INFORMATION
Turn over
Section A: The Basics (Standard Frequency)
1
Complete the sentences below using the correct terms from the list.
List: Boundary, Syntax, Normal, Erroneous, Logic, Valid, Iterative.

(a) Data that is within the limits of what the program should accept is called ................................. data.
[1]

(b) Data that is of the correct type but is outside the accepted range is called ................................. data.
[1]

(c) Data that is of the incorrect type (e.g., entering text into a number field) is called ................................. data.
[1]
2
A program accepts an integer input for a student's age. The valid range is 11 to 18 inclusive.
Complete the test plan below.
[3]
Test Data Type of Test Data Reason for Test
14 Normal To check that a mid-range valid value is accepted.
(a) .......... Boundary To check that the lowest valid value is accepted.
19 (b) ......................... To check that data just above the upper limit is rejected.
"Ten" (c) ......................... To check that incorrect data types are handled.
Section B: Ghost Topics (Low Frequency / High Risk)
3
A student has written a test plan for a program that validates a password.
Rule: Password must be longer than 6 characters.
Test Data: "Secur" | Type: Invalid | Reason: "To see if the program works"
(a) Explain why the reason "To see if the program works" would be awarded 0 marks by an examiner.
[1]

(b) Write a corrected, precise "Reason for Test" for the data "Secur".
[2]
Turn over
4
A username must be between 5 and 10 characters long (inclusive).
Complete the specific test plan below for this validation rule.
[4]
Test Data (Actual String) Type of Test Expected Outcome
"UserOne" Normal Access Granted
(a) ................................. Boundary (Lower Valid) Access Granted
(b) ................................. Boundary (Upper Valid) Access Granted
"Hi" Invalid (Length) (c) ..............................................................
........................................................................
5
A programmer is testing a calculator app. When they enter "ABC" instead of a number, the program crashes with a red error message from the Python interpreter.

(a) State the type of error that causes a program to crash during execution.
[1]

(b) The programmer wants the Expected Outcome to be "Robust". Write a short algorithm that:
  • Asks for a number.
  • Uses Casting to convert it.
  • Uses try / except (or a check) to prevent the crash if "ABC" is entered.
  • Outputs "Invalid Input" instead of crashing.
[4]
6
An algorithm determines the price of a train ticket based on age.
Child (Under 16): £5.00 | Adult (16 and over): £10.00
age = int(input("Enter age: ")) if age < 16: print("£5.00") elif age > 16: print("£10.00")
(a) Identify the Logic Error in the code concerning the boundary value.
[1]

(b) If the test data 16 is entered, what is the current output of this specific code?
[1]

(c) Explain how a Boundary Test using the value 16 would help the programmer identify this error.
[2]
7
A vending machine asks for a code between 100 and 999.
Review the incorrect test plan below. Identify two mistakes in the classification of data.
Data: 500 | Classification: Normal Data: 99 | Classification: Erroneous Data: "XYZ"| Classification: Invalid
(a) Mistake 1: The value 99 is wrongly classified.
[2]
What should it be? ....................................
Reason: .......................................................................................................................

(b) Mistake 2: The value "XYZ" is wrongly classified.
[2]
What should it be? ....................................
Reason: .......................................................................................................................
END OF QUESTION PAPER