Automated test generation with AI tools
AI can draft assert tests for a module, but you must check each expected output by hand to be sure it is correct. Also add any normal, boundary or invalid cases it missed.
Understanding Automated test generation with AI tools in VCE Software Development U3O1
What it does: A good prompt names the types of test wanted, so the AI drafts a wider range of cases. Working the calculation out by hand shows the AI expected value is wrong (it should be 30), so the test must be fixed. Passing tests only show the code matches what the tests expect. Wrong expected values or missing cases can hide bugs. -5 is outside the allowed range, so it tests how the function handles invalid input. 85 is a normal value. A test runner runs every test each time and reports passes and failures, so you can re-test quickly after changes.
Common mistakes: The AI's expected output is wrong. The function uses >= 18, so age 18 is an adult and the boundary test must expect True. Always check each expected value by hand. => is not a valid Python comparison operator, so this is a syntax error. It should be >=.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 178–193) and word search (Modules 168–193).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
assertFill in the Blanks
Spot the Error
Student with a class code? Join your class →