Computing
Debug the Star Machine
The star machine should reward scores of ten or more. Predict what its current rule does at 9, 10 and 11, then find the comparison that needs changing and test the repaired rule.

Read the material
Download PDFA teaching sequence
Use boundary test cases to identify and repair an incorrect comparison.
Predict the result produced by score > 10 for a score of 9
Reveal it and compare it with the intended output.
Test 10 and 11
Identify the boundary case that shows a difference between the rule and the requirement.
Change the comparison to score ≥ 10 and rerun all three scores
Explain why checking only 11 would miss the defect.
Before you teach
Look for the thinking behind an answer, choose the support your class needs and leave room for an independent response.
What to look for
A pupil distinguishes what the existing code does from what it should do and identifies 10 as the decisive case.
Give a little support
Set up a two-row trace for expected and actual results before running the game.
Take the idea further
Write a similar rule for a score that must be at most 20 and give a test case on each side of the boundary.
Things to keep in mind
This is a simple comparison-rule example with three scores and one boundary.
Keep the idea. Make it yours.
Bring your topic, learning goal and class context to PLAI™, then review what you create.
Ideas to try with your class
Sample teaching perspectives on what to try, what to adapt and what to watch for.



Steady Marker
Predict what score greater than ten produces for an input of nine, then compare the actual output with the stated requirement. Keep expected and observed results separate.
Step by Step
Use after greater than and greater than or equal to have been introduced. Testing around the boundary gives pupils evidence for changing the comparison rather than guessing a fix.
Five More Minutes
Prepare a two-row trace for expected and actual outputs. Read the requirement aloud for each score before running its test.
Reread Reminder
This example has three scores around one boundary. Write an at-most-twenty rule afterwards and propose tests below, on and above that new boundary.