Algorithms and programming · GCSE Computer Science
Robust testing
GCSE Computer Science robust testing: normal, boundary and erroneous data, test plans, expected versus actual, and why testing cannot prove zero bugs.
Test normal (should work), boundary (edges of valid range), erroneous (should fail safely). Expected vs actual in a table — robust means handles all three.
The important bits
What you need to know
- 1
Robust programs behave correctly for valid input and fail gracefully for invalid input without crashing.
- 2
Normal test data: values that should work — middle of range, typical user input.
- 3
Boundary test data: edges of valid range — min, max, just inside valid limits. Errors often hide at boundaries.
- 4
Erroneous / invalid test data: should be rejected with a message, not crash — negative age, empty string, 13th month.
- 5
A test plan lists: test number, input, expected output, actual output, pass/fail.
- 6
Syntax errors caught by translator; logic errors only found by testing — program runs but wrong answer.
- 7
Iterative testing: test, fix, retest after changes. Regression testing re-runs old tests after fixes.
- 8
Testing shows presence of bugs, not absence — exhaustive test of all inputs is impossible for most programs.
Quotations worth analysing
Short evidence. Real method.
“Normal, boundary, erroneous”
Three buckets every robust test plan names. Boundary is not “weird numbers” — it is min/max valid. Erroneous is invalid.
“Expected versus actual”
Actual comes from running the program. Mismatch flags fail — then debug. Expected from specification.
“Testing cannot prove a program is bug-free”
Infinite or huge input spaces. GCSE ethics of testing: find bugs, not mathematical proof of correctness (unless formal methods — not GCSE).
Go deeper
Boundary examples
Age 0–120 valid: test 0, 120, 1, 119 normal-ish; boundary 0 and 120; erroneous −1, 121, “twelve”, empty. Password 8–16 chars: test length 7, 8, 16, 17. Array index 0 to n−1: test first, last, index −1 erroneous. Loop 1 to 10: boundary 1 and 10 executions. Integer overflow on 32-bit — extension. GCSE loves “percentage 0 to 100” with 0, 100, −1, 101. State why each category chosen in one word.
Go deeper
Writing the test plan
Login: Test 1 normal user/pass correct → access granted. Test 2 boundary shortest allowed password length. Test 3 erroneous blank password → error message, no crash. Test 4 erroneous SQL injection string → rejected safely. Columns: ID, input, expected, actual, pass/fail. NEA requires test evidence screenshots or table. Retest after fix — new actual column. Peer testing finds usability bugs normal data misses.
Go deeper
Types of error
Syntax: translator stops. Logic: wrong formula, infinite loop on boundary. Runtime: divide by zero if not guarded — robust code checks before divide. Erroneous data testing targets runtime and logic failures on bad input. Defensive programming: validate before process. Exception handling try/catch on some languages — GCSE pseudocode may use IF valid THEN process ELSE error message.
See the idea in action
Program accepts exam score 0–100 integer. Normal: 50 → accept, display grade. Boundary: 0 and 100 → accept. Boundary adjacent: just valid 0, 100 vs invalid −1, 101. Erroneous: −5, 150, 50.5, “fifty” → reject with message, no crash. Test plan row: Input 101, Expected “Invalid score”, Actual “Invalid score”, Pass.
Exam technique
Turn knowledge into marks
Always give three test types with scenario-specific values. “Boundary” must be edge of valid range, not random large numbers.
Common mistakes
Do not give these marks away
- 01
Using only normal data in a test plan when the question asks for robust testing.
- 02
Calling 50 boundary data for range 0–100 — it is normal, not edge.
- 03
Expecting erroneous data to produce a correct useful output instead of rejection.
For age input allowed 18–65, which is boundary test data?
A30
B18 and 65
C17 and 66
D18 and 65 only if erroneous
Show the answer
18 and 65. Boundary tests valid edges 18 and 65. 30 is normal. 17 and 66 are erroneous (just outside valid).
Quick questions
If this is the bit you searched
What is boundary test data?
Values at the edges of the valid range — minimum, maximum, and sometimes just inside limits where bugs appear.
What is erroneous test data?
Invalid input that should be rejected — wrong type, out of range, empty — program should not crash.
What is a test plan?
Document listing tests with inputs, expected results, actual results, and pass/fail for systematic checking.
Why can testing not find all bugs?
Too many possible inputs and paths; testing shows bugs exist when found, not that none remain.