Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Analyse an existing program and make amendments to enhance functionality
Learning Objective/s:
  • Describe the systematic process for analysing existing code and identifying faults.
  • Apply appropriate testing techniques (unit, integration, boundary‑value) to verify current behaviour.
  • Modify code to add or improve functionality while maintaining reliability and documenting changes.
  • Evaluate the impact of amendments by extending and executing a comprehensive test suite.
Materials Needed:
  • Projector or interactive whiteboard
  • Computers with a Python IDE installed
  • Printed handout of the sample factorial program
  • Test‑case template worksheets
  • Whiteboard markers and sticky notes for peer review
Introduction:

Begin with a quick poll: “When you inherit code, what’s the biggest headache?” Capture responses, then link to the importance of systematic testing and maintenance. Review the previous lesson’s coverage of unit testing. State today’s success criteria: students will analyse a given program, create new test cases, and implement a documented amendment.

Lesson Structure:
  1. Do‑now (5'): Students list common faults they have seen in code (brainstorm on sticky notes).
  2. Mini‑lecture (10'): Recap testing types and introduce the structured analysis checklist.
  3. Guided practice (15'): Walk through the factorial example, trace with sample data, identify the off‑by‑one error and missing validation.
  4. Independent task (20'): Students receive a new short program, complete the analysis steps, fill out a test‑case table, and propose an amendment.
  5. Pair programming (15'): Implement the amendment, run both original and new test cases, record results.
  6. Documentation sprint (10'): Update code comments and a maintenance log entry.
  7. Peer review & whole‑class debrief (10'): Share findings, discuss design impact, and answer questions.
Conclusion:

Summarise the five‑step amendment workflow and highlight how thorough testing protects against regressions. Ask each student to write one “exit ticket” sentence describing the most valuable new skill they gained. Assign homework: locate a piece of personal code, apply the analysis checklist, and draft two additional test cases.