Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Correct identified errors
Learning Objective/s:
  • Describe the main types of programming errors (syntax, logical, runtime, interface, performance) and their typical causes.
  • Apply a systematic debugging process (reproduce, isolate, analyse, fix, retest, document) to locate and correct errors.
  • Use debugging tools such as print‑debugging and an interactive IDE debugger to isolate faulty code.
  • Document corrections clearly and perform regression testing to ensure no new errors are introduced.
  • Relate error‑correction activities to the three maintenance phases (corrective, adaptive, perfective).
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Computers with a Java/C++ IDE installed
  • Printed handout of the “Types of Errors” table
  • Sample buggy program (factorial example) on USB or shared drive
  • Debugging checklist worksheet
  • Version‑control log template
Introduction:

Begin with a short video clip of a high‑profile software bug to hook students. Ask them to recall recent bugs they have seen or caused and link this to the importance of systematic debugging. Explain that by the end of the lesson they will be able to locate, fix, and document an error using a proven six‑step process.

Lesson Structure:
  1. Do‑Now (5'): Students list three bugs they have encountered and classify them (syntax, logical, etc.).
  2. Mini‑lecture (10'): Overview of error types and the systematic correction cycle, using a slide of the error table.
  3. Demonstration (10'): Teacher debugs the factorial example live, showing reproduce → isolate → analyse → fix → retest → document.
  4. Guided Practice (15'): In pairs, students work on a provided buggy program, following the six‑step process and recording each step on the checklist.
  5. Check for Understanding (5'): Quick Kahoot/quiz on the order of the debugging steps and key actions for each error type.
  6. Documentation Activity (5'): Students add a comment to the corrected code and fill out a version‑control log entry.
  7. Summary & Reflection (5'): Review the checklist, discuss common pitfalls, and answer any lingering questions.
Conclusion:

Recap the six‑step debugging cycle and emphasise the role of documentation and regression testing. For the exit ticket, each student writes one error type and its most effective corrective action. Homework: debug the supplied “shopping cart” script, applying the cycle and submitting a brief change log.