QA Points 0 / 26
QA Rank Manual Clicker

2.3

Robust Programs (Test Plans & Data)

Question 1 [3 Marks]
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]
✅ Mark Scheme

1: (a) Normal (1)
(b) Invalid (or Boundary Invalid) (1)
(c) Erroneous (1)

Score:
Question 2 [3 Marks]
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.
✅ Mark Scheme

2: (a) 11 (1)
(b) Invalid (or Boundary Invalid) (1)
(c) Erroneous (1)

Score:
Question 3 [3 Marks]
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]
✅ Mark Scheme

3: (a) It is too vague / It does not explain what is being tested. (1)
(b) To check that a password shorter than 6 characters (5 chars) is rejected. (2)

Score:
Question 4 [4 Marks]
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) ..............................................................
........................................................................
✅ Mark Scheme

4: (a) "ABCDE" (Any string exactly 5 chars long) (1)
(b) "ABCDEFGHIJ" (Any string exactly 10 chars long) (1)
(c) Error message displayed / User asked to input again. (2)

Score:
Question 5 [5 Marks]
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]
✅ Mark Scheme

5: (a) Runtime Error (or Execution Error) (1)
(b) num = input("Enter number")
if num.isnumeric(): (or try/except) (1)
  x = int(num) (1)
else: print("Invalid Input") (1)

Score:
Question 6 [4 Marks]
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]
✅ Mark Scheme

6: (a) It does not handle the number 16 (gap in logic). (1)
(b) Nothing / Blank / No Output (1)
(c) Entering 16 is the exact boundary (1). It would show the programmer that 16 produces no result, highlighting the missing = sign. (1)

Score:
Question 7 [4 Marks]
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: .......................................................................................................................
✅ Mark Scheme

7: (a) Should be: Invalid (1). Reason: It is the correct data type (Integer) but outside the range. (1)
(b) Should be: Erroneous (1). Reason: It is the wrong data type (String input for Integer field). (1)

Score: