We are learning to
- We are learning to compare algorithm output against expected cases.
- We are learning to test boundary and invalid inputs before trusting a result.
Success criteria: I can…
- I can complete a six-case expected-versus-actual table.
- I can explain one fault and test a correction.
Lesson sequence
45 min total- 1
Read complete pseudocode
Starter 0–9 minTeacherSupply original rule: “INPUT seats; IF seats <= 20 THEN display BOOK ELSE display FULL.” The fictional room allows whole-number bookings from 1 to 20 inclusive. No student names or real bookings are used. Ask what the rule forgot to check.
StudentsPredict outputs for 1, 20 and 21 seats.
Printed pseudocode Room rule - 2
Run six exact cases
Main 9–23 minTeacherSupply expected table: input 0 -> INVALID; 1 -> BOOK; 19 -> BOOK; 20 -> BOOK; 21 -> FULL; text “five” -> INVALID. For the original rule, 0 returns BOOK, while text input depends on the implementation and must be rejected rather than assumed to compare numerically. Mark 0 as definite failure and text as unhandled.
StudentsComplete expected/actual/decision columns and circle mismatches or missing handling.
Six-case table - 3
Revise and retest
Main 23–35 minTeacherSupply corrected pseudocode: “IF seats is not an integer THEN INVALID; ELSE IF seats < 1 THEN INVALID; ELSE IF seats <= 20 THEN BOOK; ELSE FULL.” Retest all six supplied cases and add 22. Ask why tests at 0, 1, 20 and 21 are especially useful.
StudentsTrace corrected outputs, record 22 -> FULL and explain the boundary coverage.
Corrected pseudocode Test table - 4
Explain limits
Plenary 35–45 minTeacherAsk whether six successful tests prove the program has no errors (no), and what else could be tested, such as a very large integer or a negative integer. Distinguish testing from a claim of complete correctness.
StudentsWrite one fault, one successful retest and one remaining test idea.
Exit slip
Key vocabulary
Differentiation
Support
- Provide a complete model and allow an oral response before independent work.
Extension
- Ask learners to explain a second valid choice using the same year-level ideas.
Accessibility
- Offer larger print, a spoken reading of cards, and a seated role where movement occurs.
Assessment
- Collect a completed expected/actual table and a reasoned correction with boundary tests.
Resources
- Original and corrected pseudocode cards
- Six-case expected table
- Exit slips
Safety notes
- Use fictional seat counts only; no account or student data is entered.
- The lesson is a paper simulation and needs no live booking system.