Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Understand how to create a maintainable program
Learning Objective/s:
  • Describe the key principles of maintainable code, including readability, modularity, documentation, testing, and version control.
  • Apply appropriate naming conventions and formatting to improve code readability.
  • Construct modular functions and write effective doc‑strings.
  • Design and execute unit and integration tests for simple programs.
  • Use basic Git commands to track changes and document revisions.
Materials Needed:
  • Projector or interactive whiteboard
  • Computer lab with IDE (Python/Java)
  • Sample code handouts
  • Printed maintainability checklist
  • Git client installed on each computer
  • Whiteboard markers
Introduction:
Begin with a quick poll: how many students have struggled to understand or modify code they wrote weeks ago? Review that readability and structure are essential foundations. Explain that today they will learn practical techniques to make their programs easier to maintain and will demonstrate these by improving a sample script.
Lesson Structure:
  1. Do‑now (5') – Examine a poorly formatted code snippet and list the issues.
  2. Mini‑lecture (15') – Present key principles of maintainability, naming conventions, and effective commenting.
  3. Guided practice (20') – In pairs, refactor the sample code using proper indentation, naming, and add doc‑strings; teacher circulates.
  4. Testing demo (10') – Show how to write simple unit tests and run them in the IDE.
  5. Version control activity (10') – Initialise a Git repository, make a commit with a clear message, and push to a shared folder.
  6. Checklist audit (5') – Complete the maintainability checklist for the refactored program.
  7. Whole‑class reflection (5') – Discuss common pitfalls and confirm success criteria.
Conclusion:
Summarise that readable, modular code combined with testing and version control creates sustainable programs. Students complete an exit ticket describing one change they will apply to future code. Assign homework to refactor a personal script using the checklist and submit a Git commit log.