Testing a visual program
Running your program with chosen test inputs and comparing what happens to the result you expected. Test every path, so each branch of the program gets checked.
Understanding Testing a visual program in Years 5–6 Creating Digital Solutions
What it does: An if-else block has two paths. One test input for each path makes sure both branches get checked. When you run the test, you compare what really happened with what you expected. If they match, the test passes. A test input is the value you give the program when you run it, like typing 5 when it asks. One matching result only shows that one path works. Other paths still need testing. A mismatch shows there may be a bug. Debug the program instead of changing the expected result. Run your tests again to check the fix worked and did not break another path.
Common mistakes: The rule says a score over 10 says Win. The test input is 15, so the expected result must be say Win, not say Lose. The expected result is say Child, but age 20 is not under 13. The test input should be a number below 13, such as 8.
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 61–74) and word search (Modules 41–74).
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
testingFill in the Blanks
Spot the Error
Student with a class code? Join your class →