Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Show understanding of ways of exposing and avoiding faults in programs
Learning Objective/s:
  • Describe the difference between faults, errors, and failures in software.
  • Explain static and dynamic testing techniques and when to use them.
  • Apply test‑design methods such as equivalence partitioning and boundary value analysis to create effective test cases.
  • Evaluate statement and branch coverage metrics to assess testing adequacy.
  • Recommend coding practices (defensive programming, standards, TDD) to prevent faults.
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Laptop with IDE (e.g., VS Code) and sample code
  • Printed handout of test‑case design techniques
  • Static analysis tool demo (e.g., SonarQube)
  • Worksheets for equivalence partitioning activity
Introduction:

Begin with a quick recall: “What went wrong in your last coding project?” Collect a few examples of faults, errors, and failures. Link these to today’s focus on systematic ways to expose and avoid faults. Explain that by the end of the lesson students will be able to design, execute, and evaluate effective tests.

Lesson Structure:
  1. Do‑Now (5’) – Students list examples of faults, errors, and failures from recent projects; teacher records responses.
  2. Mini‑lecture (15’) – Overview of testing types (static vs dynamic, white‑box, black‑box, grey‑box) with slide examples.
  3. Interactive demo (10’) – Run a static analysis tool on sample code and discuss identified faults.
  4. Guided practice (15’) – In pairs, design test cases for a given function using equivalence partitioning and boundary value analysis; record on worksheet.
  5. Coverage activity (10’) – Calculate statement and branch coverage for the created test suite; discuss adequacy.
  6. Reflection & Q&A (5’) – Summarise key strategies for exposing and avoiding faults; answer remaining questions.
Conclusion:

Recap the testing techniques and how coverage metrics guide improvement. Students complete an exit ticket: “One test design method I will use next time and one coding practice to avoid faults.” Assign homework to apply TDD on a small programming task and document the test cases.