Testing is the process of running a program with specific inputs to check it produces the correct outputs. A well-tested program works correctly under all conditions — not just the ones we expect.
| Type | What it is | Example (age field, valid: 0–120) |
|---|---|---|
| Normal | Typical, expected input within range | 25, 40, 65 |
| Boundary | Values at the extreme edges of the valid range | 0, 1, 119, 120 |
| Erroneous | Invalid data that should be rejected | -1, 121, "hello", 200 |
Why boundary testing matters: Off-by-one errors are common. A condition written as > instead of >= would fail at exactly the boundary value. Boundary tests catch these precisely.
| Error type | When it occurs | Example |
|---|---|---|
| Syntax error | Before running — code violates Python rules | Missing colon: if x > 0 |
| Runtime error | During execution | Dividing by zero, index out of range |
| Logic error | Program runs but gives wrong output | Using + instead of *, wrong condition |
A test table (or test plan) records the tests you run, expected output, and actual output. It's used to document testing systematically.
| Test | Input | Expected output | Type | Pass/Fail |
|---|---|---|---|---|
| 1 | 50 | "Valid age" | Normal | Pass |
| 2 | 0 | "Valid age" | Boundary | Pass |
| 3 | 120 | "Valid age" | Boundary | Pass |
| 4 | -1 | "Invalid" | Erroneous | Pass |
| 5 | "abc" | "Must be a number" | Erroneous | Pass |
Testing should happen throughout development, not just at the end:
8 Edexcel-style questions · instantly marked
| Term | Definition |
|---|
Timed exam-style test — 10 minutes.