Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Test algorithms using trace tables and test data
Learning Objective/s:
  • Describe the purpose of testing algorithms with trace tables and test data.
  • Identify and categorize test data into normal, boundary, extreme, and error cases.
  • Construct trace tables that record variable states after each algorithm step.
  • Apply selected test data to validate algorithm outputs and locate logical errors.
  • Evaluate the completeness of testing using a checklist of common pitfalls.
Materials Needed:
  • Projector and screen
  • Whiteboard and markers
  • Printed worksheets with pseudocode and blank trace tables
  • Laptops or computers with a simple IDE or text editor
  • Sample test‑data cards (normal, boundary, extreme, error)
  • Answer key and checklist handout
Introduction:

Begin by asking students to imagine a program that works perfectly for most inputs but crashes on a few unexpected ones. Recall that they already know how to write basic pseudocode. Explain that today they will learn how to systematically test those algorithms using trace tables and carefully chosen test data, and they will be able to demonstrate their success by producing accurate trace tables for multiple test cases.

Lesson Structure:
  1. Do‑now (5'): Quick written response to “Why is testing an algorithm important?” – share a few answers.
  2. Mini‑lecture (10'): Introduce the four categories of test data (normal, boundary, extreme, error) with concrete examples.
  3. Demonstration (10'): Teacher models building a trace table for the normal case of the “Maximum of three numbers” algorithm.
  4. Guided practice (15'): Pairs complete a trace table for a boundary‑case test set, teacher circulates to provide feedback.
  5. Independent practice (15'): Students finish trace tables for extreme and error cases, then compare results with the answer key.
  6. Check for understanding (5'): Whole‑class review of common pitfalls and the summary checklist.
Conclusion:

Recap the steps for creating trace tables and the importance of covering all four test‑data categories. For the exit ticket, ask each student to write one additional test case they would add for the algorithm and explain why. Assign homework: choose a new simple algorithm (e.g., calculate the average of five numbers) and produce a complete set of trace tables using normal, boundary, extreme, and error test data.