Skip to content
Computing · Year 7

Active learning ideas

Debugging and Testing

Active debugging and testing show students that errors are not just mistakes to avoid but puzzles to solve. Working with real buggy code in these activities helps students connect theory to practice, building confidence and competence in computational thinking through hands-on problem solving.

National Curriculum Attainment TargetsKS3: Computing - Programming and Development
30–45 minPairs → Whole Class4 activities

Activity 01

Problem-Based Learning30 min · Pairs

Pair Swap: Buggy Code Exchange

Pairs create a simple Scratch program with one deliberate bug, such as a misplaced conditional. They swap programs, predict paths using flowcharts, test systematically, and note fixes. Debrief as a class on shared solutions.

How would you test every possible path through a program with multiple branches?

Facilitation TipDuring Pair Swap, circulate to ensure partners are verbalizing their thought processes, not just pointing at blocks.

What to look forProvide students with a short Scratch project containing 2-3 common bugs (e.g., an infinite loop, a misplaced conditional). Ask them to identify the bugs, describe the incorrect behavior, and write down the line numbers or blocks they would change to fix it.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Stations Rotation45 min · Small Groups

Stations Rotation: Error Types Hunt

Set up stations for syntax, logic, and runtime bugs in Scratch files. Small groups test each, record symptoms and fixes on worksheets, then rotate. End with groups presenting one fix to the class.

Identify common types of errors in Scratch programs and propose solutions.

Facilitation TipFor Station Rotation, provide a clear checklist at each station so students focus on the error type, not just the activity itself.

What to look forGive students a scenario: 'Your sprite is supposed to say 'Hello!' but it keeps saying 'Goodbye!''. Ask them to list two possible causes for this bug and one step they would take to test their hypothesis.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 03

Problem-Based Learning35 min · Whole Class

Whole Class: Path Testing Challenge

Display a branched Scratch program on the board. Students individually list all paths, then vote on test cases as a class. Run the code live, debugging live errors together while noting why exhaustive testing matters.

Design a systematic approach to debugging a complex Scratch project.

Facilitation TipIn the Path Testing Challenge, model step-through execution using a projector so students see how to isolate branches before testing.

What to look forStudents work in pairs on a debugging challenge. One student intentionally introduces a bug into a simple program, then swaps with their partner. The partner must find the bug, explain what it is, and demonstrate the fix. They then swap roles.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 04

Problem-Based Learning40 min · Individual

Individual: Debug Journal

Students receive a complex Scratch project file. They log tests, errors found, and fixes in a journal template, iterating until it runs perfectly. Share one entry in pairs for feedback.

How would you test every possible path through a program with multiple branches?

What to look forProvide students with a short Scratch project containing 2-3 common bugs (e.g., an infinite loop, a misplaced conditional). Ask them to identify the bugs, describe the incorrect behavior, and write down the line numbers or blocks they would change to fix it.

AnalyzeEvaluateCreateDecision-MakingSelf-ManagementRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teach debugging as a detective skill, emphasizing that bugs are clues, not failures. Avoid rushing to fixes; instead, guide students to slow down and test hypotheses. Research shows that students benefit most when they verbalize their reasoning, so require explanations at every step. Avoid demonstrations of perfect code; show messy, buggy processes to normalize the struggle.

Students will confidently identify, explain, and fix logic-based errors in Scratch programs. They will also develop the habit of testing all possible paths in code, not just the obvious ones. By the end, students should articulate their debugging process and value iteration as a core part of programming.


Watch Out for These Misconceptions

  • During Pair Swap, watch for students assuming the first visible error is the only one present.

    During Pair Swap, require students to write down all errors they find before swapping back, using the buggy code printout to mark each issue and its location.

  • During Station Rotation, watch for students treating errors as one-time mistakes to be corrected immediately.

    During Station Rotation, have students record each error on a sticky note with the path they took to reach it, reinforcing that errors are part of the process.

  • During Path Testing Challenge, watch for students stopping after the first successful path they find.

    During Path Testing Challenge, ask students to use colored highlighters to mark every path they test, ensuring they account for all possible branches in the code.


Methods used in this brief