Scenario: A program accepts a student age between 11 and 18.
Typical valid values that the program should accept and process correctly.
14 ✓
16 ✓
13 ✓
Values at the extreme edges of the valid range — should be accepted (or just rejected).
11 ✓ (lower boundary)
18 ✓ (upper boundary)
10 ✗ (just outside)
19 ✗ (just outside)
Invalid data that the program should reject — wrong type, format, or wildly out of range.
"hello" ✗ (wrong type)
-5 ✗ (negative)
999 ✗ (out of range)
12.5 ✗ (wrong type)
Breaks the rules of the language. The program cannot run at all.
pritn("Hello")
# Misspelled keyword
Detected by: compiler/interpreter before execution.
Program runs but produces wrong results. The algorithm is incorrect.
average = total + count # Should be: total / count
Detected by: testing with known inputs/outputs.
Program starts but crashes during execution. An impossible operation occurs.
x = 10 / 0 # Division by zero error
Detected by: running the program with edge-case inputs.
Checking data meets expected criteria before processing. Types: range check (within limits), type check (correct data type), length check (correct number of characters), presence check (field not empty), format check (matches expected pattern e.g. postcode).
Verifying a user's identity before granting access. Examples: username/password, security questions, biometrics, two-factor authentication.
Writing code that is easy to understand and modify: meaningful variable names, comments explaining complex logic, consistent indentation, modular design (using subroutines/functions).
Scenario: A program accepts a score between 0 and 100 (inclusive).
Classify each test value as Normal, Boundary, or Erroneous.
1. A program asks the user to enter a score between 0 and 100. Give one example of boundary data for this input. [1 mark]
Mark scheme:
0 or 100 — either is acceptable (1). Also accept 1 or 99 as "just inside" boundary values if justified.
2. Explain the difference between a syntax error and a logic error. [2 marks]
Mark scheme:
3. Describe two features of defensive design that a programmer should use to make a program more robust. [4 marks]
Mark scheme — 2 marks per feature:
4. A programmer creates a test plan for a program that accepts dates in DD/MM/YYYY format. State two pieces of erroneous data they should test. [2 marks]
Mark scheme — 1 mark each, any 2 of: