Students will be able to:
Errors are grouped into three broad categories. Recognising the category helps you choose the most appropriate testing technique.
| Error Type | Description | Typical Detection Stage | Example (Java‑like syntax) |
|---|---|---|---|
| Syntax Error | Incorrect use of language constructs; the compiler cannot translate the source code. | Compilation | int x = 5 instead of int x = 5; |
| Type Mismatch | Assigning a value of one data type to a variable of an incompatible type. | Compilation | int n = "hello"; |
| Undeclared Identifier | Using a variable or function name that has not been declared. | Compilation | total = calculateTotal(); // calculateTotal not defined |
| Division by Zero | Attempting to divide an integer or floating‑point number by zero. | Runtime (exception) | int r = a / b; // b = 0 |
| Null Reference | Dereferencing a variable that holds no object reference. | Runtime (exception) | String s = null; int l = s.length(); |
| Array Index Out of Bounds | Accessing an array element with an index outside its declared range. | Runtime (exception) | int[] a = new int[5]; a[5] = 10; // valid indices 0‑4 |
| Logical Error | Algorithmic mistake that yields wrong output despite successful compilation and execution. | Testing (system / integration) | if (score > 50) … instead of if (score >= 50) … when the pass mark is 50. |
| Off‑by‑One Error | Loop iterates one time too many or too few. | Testing (unit) | for (i = 0; i <= n; i++) when only n items should be processed. |
| Resource Leak | Failure to release system resources such as files, sockets or memory. | Testing (system) and Maintenance | Opening a file with new FileReader("data.txt") but never calling close(). |
| Concurrency Error | Incorrect handling of shared data in multi‑threaded programs (e.g., race conditions, deadlock). | Testing (stress) and Maintenance | Two threads increment the same counter without synchronization. |
Choosing effective test data is as important as choosing the right testing technique.
min‑1, min, min+1, max‑1, max, max+1.| Test ID | Objective | Test Case / Description | Input Data | Expected Result | Pass/Fail | Responsible |
|---|---|---|---|---|---|---|
| T01 | Verify age validation | Boundary‑value test for age field | 0, 1, 2, 119, 120, 121 | Accept 1‑120, reject others | Student | |
| T02 | Check division routine | Black‑box test of divide(a,b) | (10, 2), (10, 0) | 5 for first pair; runtime exception for second | Student | |
| T03 | Detect off‑by‑one in loop | White‑box walk‑through of for (i=0;i<=n;i++) | n = 5 | Loop executes 5 times, not 6 | Student | |
| T04 | Resource‑leak check | System test – open and close file repeatedly | 1000 iterations | No “Too many open files” error | Student |
| Review Area | What the syllabus demands | Typical gaps observed in the notes | Suggested actions |
|---|---|---|---|
| 1. Coverage of Required Topics (Unit 12) |
|
|
|
| 2. Depth & Accuracy (AO1 & AO2) |
|
|
|
| 3. Alignment with Syllabus Numbering |
|
|
|
| 4. Use of Visual Aids |
|
|
|
| 5. Assessment‑Focused Presentation |
|
|
|

| Category | Typical Errors | Detection Method |
|---|---|---|
| Syntax (Compile‑time) | Missing semicolon, type mismatch, undeclared identifier | Compiler / interpreter messages |
| Runtime | Division by zero, null reference, array‑index out of bounds, resource leak, concurrency error | Exception handling, runtime monitoring, static analysis tools |
| Logical (Semantic) | Off‑by‑one, incorrect condition, wrong formula, misplaced loop | Unit/white‑box testing, walkthroughs, system testing |
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.