Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Locate and identify the different types of errors
Learning Objective/s:
  • Describe the three main categories of programming errors (syntax, runtime, logical) and their common sub‑types.
  • Identify typical examples of each error type and explain when they are detected during development.
  • Apply appropriate testing techniques (compilation, unit testing, integration testing, etc.) to locate each error type.
  • Evaluate how identified errors inform different maintenance activities (corrective, adaptive, perfective, preventive).
Materials Needed:
  • Projector or interactive whiteboard
  • Computer with an IDE (e.g., VS Code, Eclipse) for live coding
  • Printed handout of the error‑type table
  • Sample code snippets containing intentional errors
  • Static analysis tool or compiler output screen
  • Worksheets for error classification activity
Introduction:

Begin with a quick story: a program crashes moments before a deadline, leaving the team scrambling. Ask students to recall recent bugs they have seen and what caused them. Highlight that understanding error types helps predict where bugs will appear, and outline today’s success criteria: students will be able to name, locate, and suggest detection methods for common errors.

Lesson Structure:
  1. Do‑now (5'): Students write down three bugs they have encountered and classify them informally.
  2. Mini‑lecture (10'): Present the three error categories with concise examples, using the projected handout.
  3. Guided coding demo (15'): Instructor runs sample code showing a syntax error, a runtime error, and a logical error, demonstrating how each is detected (compiler messages, exceptions, failed tests).
  4. Group activity (15'): In pairs, students examine prepared snippets, label the error type, and indicate the most likely detection stage (compilation, static analysis, unit test, etc.).
  5. Static analysis showcase (10'): Run a static analysis tool on a snippet to reveal hidden runtime issues, discussing why the tool catches them early.
  6. Plenary & exit ticket (5'): Quick quiz (e.g., “Which testing phase would catch an off‑by‑one error?”) and a one‑sentence reflection on how error identification guides maintenance.
Conclusion:

Recap the three error categories and the testing techniques that expose them. Collect exit tickets to gauge understanding and assign a short homework: students must find and document at least two errors in a provided code file and suggest the appropriate maintenance action.