Unable to open this exercise
Common exam pitfall
Students often provide only the valid boundary value and omit the adjacent invalid value when asked for boundary test data.
Testing is the systematic execution of a program with curated test data to uncover syntax, logic, and runtime errors before software is deployed to users.
1. The Four Categories of Cambridge Test Data
Consider a validation rule requiring a student's examination score to be an integer between 0 and 100 inclusive ($0 \le \text{Mark} \le 100$):
Test Data Category | Definition | Example Values ($0 \le \text{Mark} \le 100$) | Expected System Behavior |
|---|---|---|---|
Normal | Data that is completely valid and lies comfortably within the expected range. |
| Accepted and processed normally. |
Extreme | Valid data situated on the exact upper and lower boundary limits. |
| Accepted as valid boundary values. |
Boundary | The pair of values on either side of each boundary limit (one valid extreme and one immediate adjacent invalid). | Lower limit: | Extreme value accepted; neighboring value rejected. |
Erroneous (Abnormal) | Data that falls completely outside allowable limits, has the wrong data type, or violates format rules. |
| Rejected with a clear error prompt. |
2. Why Boundary Testing is Essential
Programmers frequently introduce off-by-one errors when writing conditional operators (e.g. accidentally typing > instead of >=):
// Flawed boundary condition:
IF (Mark > 0) AND (Mark < 100) THEN ...
- A normal test value like
50will pass this flawed code without revealing the bug. - Only testing the extreme boundary values (
0and100) reveals the error, because the flawed code erroneously rejects legitimate scores of0%and100%!
3. Structure of a Formal Test Plan
In Cambridge Paper 2, candidates are frequently asked to construct or complete a test plan table:
Test Case ID | Test Data Input | Test Data Type | Reason for Test | Expected Outcome |
|---|---|---|---|---|
|
| Normal | Typical valid percentage mark | Accepted and grade calculated |
|
| Extreme / Boundary | Minimum valid allowable score | Accepted |
|
| Boundary / Erroneous | Immediate value below lower threshold | Rejected with error message |
|
| Extreme / Boundary | Maximum valid allowable score | Accepted |
|
| Boundary / Erroneous | Immediate value above upper threshold | Rejected with error message |
|
| Erroneous | Non-numeric string data type | Rejected with type error message |
Independent test plan
A whole-number booking size must be from 2 to 9. Propose one normal test, both extreme tests, the two boundary pairs and an abnormal type test. Write expected acceptance/rejection for each before running anything. Compare: 5 accepts; 2 and 9 accept; 1/2 and 9/10 exercise both sides of each boundary; text such as “many” is rejected. Other normal values within the range are valid choices.
AI Socratic Tutor
Need guidance? Ask a question or use the hint below.
AI Socratic Tutor is an All-Access Benefit
Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.
You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.
Exam-Style Check: Classify Boundary Test Data Pairs
• Multiple ChoiceAn algorithm validates an exam percentage mark that must be between 0 and 100 inclusive. Which set of numbers represents a complete set of boundary test data for the upper limit?
Interactive exercises for Module 2 and beyond require an active plan.