| Error Type | Typical Cause (syllabus link) | Symptoms | Corrective Action |
|---|---|---|---|
| Syntax Error | Violation of language grammar – e.g., missing semicolon, mismatched brackets (Language Translators) | Compiler/interpreter aborts; no executable produced | Read the compiler message, correct the offending line, re‑compile. |
| Logical Error | Incorrect algorithm, off‑by‑one, wrong condition (Algorithm design, data‑type limits) | Program runs but yields wrong output or behaviour | Trace the algorithm, use print‑debugging or an interactive debugger, adjust logic. |
| Runtime Error | Invalid operation during execution – division by zero, null reference, array‑index out of bounds (Memory management, exception handling) | Program aborts, throws an exception, or crashes | Validate inputs, add exception handling, ensure resources are correctly allocated. |
| Interface / Integration Error | Mismatch between modules, APIs or external systems – wrong data format, version incompatibility (Communication, client‑server protocols) | Incorrect data exchange, crashes at module boundaries, failed network calls | Check API contracts, data formats, version numbers; use mock objects or stubs for testing. |
| Performance Error | Inefficient algorithm, unnecessary I/O, resource leakage (Algorithmic efficiency, profiling) | Slow response, high CPU/memory usage, UI hangs | Profile the program, replace with a more efficient algorithm, optimise data structures, close resources. |
| Representation Error | Incorrect handling of binary, BCD, ASCII/Unicode or floating‑point numbers (Information Representation) | Wrong numeric results, garbled text, rounding anomalies | Review number‑system conversions, use appropriate data types, apply rounding or precision controls. |
| Hardware / Processor Error | Mis‑use of registers, wrong interrupt handling, treating RAM as ROM (Hardware & Processor Fundamentals) | Unexpected behaviour on specific hardware, crashes only on certain devices | Consult hardware specifications, use low‑level debugging tools, respect the fetch‑decode‑execute cycle. |
| Security / Integrity Error | Missing validation, weak encryption, absent checksums (Security & Data Integrity) | Data corruption, unauthorised access, failed integrity checks | Implement input validation, use cryptographic hashes or checksums, follow security best practices. |
print/console.log statements.| Phase | Purpose | Typical Errors Handled | Key Activities |
|---|---|---|---|
| Corrective Maintenance | Fix faults that cause the program to deviate from its specifications. | All error types discovered after deployment (syntax, logical, runtime, interface, security, etc.). | Bug tracking, root‑cause analysis, patch development, regression testing. |
| Adaptive Maintenance | Modify the system to operate in a changed environment (new OS, hardware, regulations, network protocols). | Interface errors, configuration mismatches, hardware‑specific bugs. | Impact analysis, code refactoring, compatibility testing, documentation updates. |
| Perfective Maintenance | Improve performance, readability, or add minor enhancements. | Performance errors, code‑smells, usability issues, security hardening. | Profiling, optimisation, code clean‑up, user‑feedback incorporation. |
Original C‑style code (intended to compute n! for a positive integer n):
int factorial(int n) {int result = 1;
for (int i = 1; i < n; i++) { // error: loop stops before n
result *= i;
}
return result;
}
The function returns (n‑1)! because the loop condition uses i < n. The correction is to make the upper bound inclusive.
n.int factorial(int n) {int result = 1;
for (int i = 1; i <= n; i++) { // corrected condition
result *= i;
}
return result;
}
n = 1 → 1n = 5 → 120n = 7 → 5040// Loop uses <= to include n in the product (computes n!)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.