Finding and fixing bugs in a program
Finding and fixing bugs: run the program, read the error or compare wrong output with what you expected, find the faulty line, fix one thing, then rerun to retest.
Understanding Finding and fixing bugs in a program in ACARA Digital Technologies Years 7–8
What it does: The missing closing bracket is a syntax error. It must be fixed before the program can run and logic errors can be found. The bug is inside the function (n + 2 should be n * 2). After fixing one thing, rerunning the call tests whether the fix worked. Error messages tell you what went wrong and usually which line. Reading them is the first step in debugging. Logic errors run without crashing but give the wrong answer. You find them by comparing the actual output with the expected output. No error does not mean no bugs. Retest to check the output is what you expected.
Common mistakes: Syntax error: the bracket is never closed. Fix syntax errors first. The line should be console.log(score);. Syntax error: the keyword is misspelled. JavaScript reads 'function' only when spelled exactly. Fix it, then rerun.
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 624–634) and word search (Modules 611–634).
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
debuggingFill in the Blanks
Spot the Error
Student with a class code? Join your class →