Testing and debugging programs
Test visual programs by predicting what should happen, running them, finding where the behaviour differs (bugs) and fixing them one change at a time
Share
Activity
Testing and debugging programs means predict what should happen, run it, find where behaviour differs (a bug), and fix one change at a time. We will run a paper arrow program, spot a bug, fix one step, then check a fresh short program.
Materials
- Paper “program” of 4 arrow steps for a toy/robot walk across the table
- A small toy as the runner
- Optional later: adult-previewed CS Unplugged companion
Steps
- Write 4 arrow steps to move a toy to a cup. Child predicts the path.
- Run exactly. Notice a wrong turn (bug).
- Fix only one step. Re-run and compare to the prediction.
- Fresh 3-step program. Predict → run → fix one bug if needed. Record and stop after this check.
Done
On a fresh short program, child predicts, runs, and either confirms or fixes one step. Success means predict + one-at-a-time fix habit. Note support. This samples debugging, not every programming language.
Example. If arrows say right when they should say left, the toy misses the cup. Change one arrow, then test again.
3 before 2 after
List nearby topics
This concept
Ways to teach
Pick a way to teach this topic. Come back here afterward to record progress.
Gakuva
Testing and debugging programs means predict what should happen, run it, find where behaviour differs (a bug), and fix one change at a time. We will run a paper arrow program, spot a bug, fix one step, then check a fresh short program.
CS Unplugged
Computer Sciencewithout a computer
About this link
Free computing activity hub useful for Testing and debugging programs. An adult picks one activity; not a single graded exam.
CS Unplugged. “Computer Sciencewithout a computer.” External page; Gakuva does not copy, host, embed, or redistribute materials.
Unknown — link only
Check understanding and curriculum record
Family records and proof options
Keep a record of your learning
Save photos, notes, and attendance. Export a proof packet for compliance or portfolio reviews.
Check understanding
“When your child's coding project doesn't work the way they wanted, do they test it, hunt for the 'bug' and fix it step by step rather than starting over?”
Full curriculum checks
- Predict what a short program should do for given inputs, including unusual ones (e.g. a wrong or blank answer), run it and record whether each result matched
- Find and fix a bug in a given program (e.g. a character that turns the wrong way or a loop that repeats too many times)
- Explain how they tracked down the bug (e.g. running one part at a time, checking each block against the algorithm)
Curriculum record
- Type
- Procedural
- Subject
- Computing
- Domain
- Algorithms & Programming
- Age range
- Ages 6–13
Standards