Year 9Technologies 2 weeks · 2 lessons a weekAC9TDI10P06: validate algorithms and programs by comparing their output against a range of test cases
Big idea
Input validation protects the quality of data collected for later analysis.
Essential question
How can test cases expose a faulty rule for accepting sensor readings?
We are learning to
- We are learning to define valid temperature readings for a fictional sensor.
- We are learning to compare expected and actual outputs across boundary and invalid cases.
- We are learning to correct and retest a validation algorithm.
Success criteria: I can…
- I can apply the stated numeric and inclusive-range rules to ten inputs.
- I can identify the flawed rule’s two boundary failures and its low-range failures.
- I can trace a corrected rule and explain why the repair works.
Key competenciesCritical and Creative ThinkingLiteracy
Week by week
4 lessons · 2 assessment points
| Week | Focus | Key question | Main evidence |
|---|---|---|---|
| 1 | Explore and model | How do test cases reveal errors in a booking rule? | Annotated source or model notes |
| 2 | Apply, check and improve | How do test cases reveal errors in a booking rule? | Final product and justified revision |
- 1
Week 1: Explore and model
How do test cases reveal errors in a booking rule?
- DiagnosticRecord an initial response to the essential question using supplied material.
Lesson 1Specify sensor input
Define field type and valid range.
- Supply the fictional device specification: one input temperatureC must be a number, not text or null, and must lie from −10 to 55 inclusive. A decimal such as 54.5 is valid. Output ACCEPT for valid readings and REJECT for all others. This is an invented operating range, not a claim about Australian weather.
- Students sort sample values −11, −10, 20, 55, 56 and text “20” into expected ACCEPT or REJECT. Ask why text “20” is not the number 20.
Lesson 2Trace the flawed validator
Calculate actual outputs for a complete flawed algorithm.
- Print the exact flawed pseudocode: “IF temperatureC is not a number THEN REJECT; ELSE IF temperatureC < −10 OR temperatureC < 55 THEN ACCEPT; ELSE REJECT.” Trace it in order. Because the OR condition is true for any numeric input below 55, it wrongly accepts values below −10 and wrongly rejects 55.
- Students fill the actual column in the ten-case table printed in Lesson 4, then circle disagreements with the expected column. The flawed output for −20 and −11 is ACCEPT, while 55 is REJECT.
Curriculum links
- AC9TDI10P06
Formative checkpoint
Identify relevant evidence accurately
Support
- Provide modelled language, a word bank and an oral response option.
Extension
- Justify a second choice or limitation without introducing next-year content.
Main evidence
Annotated source or model notes
- 2
Week 2: Apply, check and improve
How do test cases reveal errors in a booking rule?
- SummativeCollect the final product and a short evidence-based explanation.
Lesson 3Repair and retrace
Use an inclusive range and type check.
- Print the corrected pseudocode: “IF temperatureC is not a number THEN REJECT; ELSE IF temperatureC >= −10 AND temperatureC <= 55 THEN ACCEPT; ELSE REJECT.” The type check occurs before numerical comparisons.
- Students trace all ten cases under the corrected rule. It accepts −10, 0, 20, 54.5 and 55; it rejects −20, −11, 56, text “20” and null.
Lesson 4Report ten test cases
Compare expected, flawed actual and corrected actual outputs.
- Print this complete ten-case table, columns Input | Expected | Flawed actual | Corrected actual: −20 | REJECT | ACCEPT | REJECT; −11 | REJECT | ACCEPT | REJECT; −10 | ACCEPT | ACCEPT | ACCEPT; 0 | ACCEPT | ACCEPT | ACCEPT; 20 | ACCEPT | ACCEPT | ACCEPT; 54.5 | ACCEPT | ACCEPT | ACCEPT; 55 | ACCEPT | REJECT | ACCEPT; 56 | REJECT | REJECT | REJECT; text “20” | REJECT | REJECT | REJECT; null | REJECT | REJECT | REJECT. Students first cover the output columns and predict, then uncover to self-check.
- Students explain why −11 and 55 are useful boundary probes, describe the OR-to-AND and inclusive-bound repair, and suggest one additional numerical case. This traced pseudocode is a model, not a live data feed.
Curriculum links
- AC9TDI10P06
Formative checkpoint
Meet the success criteria and explain one revision
Support
- Provide modelled language, a word bank and an oral response option.
Extension
- Justify a second choice or limitation without introducing next-year content.
Main evidence
Final product and justified revision
Resources
- Fictional sensor specification
- Complete flawed and corrected pseudocode in Lessons 2 and 3
- Printable ten-case table in Lesson 4