Skip to content
Computer Science · 11th Grade

Active learning ideas

Debugging Techniques

Debugging demands active practice because students learn best by engaging with real errors and tools, not just reading about them. This topic sticks when students repeatedly confront bugs, test fixes, and explain their process aloud.

Common Core State StandardsCSTA: 3B-AP-16
20–35 minPairs → Whole Class4 activities

Activity 01

Think-Pair-Share25 min · Pairs

Think-Pair-Share: Bug Hunt

Each student receives a short buggy program and independently identifies what is wrong and why, without running the code. Partners then compare their diagnoses and reasoning before sharing with the class to surface the range of diagnostic approaches used.

Explain common debugging strategies and tools.

Facilitation TipDuring Bug Hunt, ask students to first read errors silently for 30 seconds before discussing, to build careful reading habits.

What to look forProvide students with a small, buggy Python script and a specific error message. Ask them to use a debugger to identify the line of code causing the error and explain, in writing, why it is incorrect.

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

Activity 02

Role Play20 min · Pairs

Role Play: Rubber Duck Debugging

Students explain their code line-by-line to a partner who acts as a 'rubber duck': they may only ask clarifying questions and may never suggest fixes. The explainer must articulate what each line does and what they expect, often locating bugs in the process of explaining.

Analyze complex code to identify the root cause of a bug.

Facilitation TipWhen students role-play Rubber Duck Debugging, require them to speak in complete sentences, modeling how to externalize thought processes.

What to look forPresent students with a scenario where a bug is difficult to reproduce. Facilitate a class discussion: 'What steps would you take to try and make this bug happen every time? What information would you need from the user reporting the bug?'

ApplyAnalyzeEvaluateSocial AwarenessSelf-Awareness
Generate Complete Lesson

Activity 03

Gallery Walk35 min · Small Groups

Gallery Walk: Annotated Bug Reports

Groups post printed buggy code samples with their initial hypothesis and debugging notes. Other groups tour the gallery, add sticky-note hypotheses of their own, and flag where they agree or disagree with the posted diagnosis.

Construct a systematic approach to debugging a given software problem.

Facilitation TipFor the Gallery Walk, have students annotate bug reports with colored sticky notes to highlight key clues they noticed.

What to look forStudents work in pairs. One student introduces a deliberate, non-trivial bug into a shared code project. The other student must then use debugging techniques to find the bug and explain their process. Partners then switch roles.

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

Activity 04

Structured Academic Controversy: Best Debugging Strategy

Present two debugging approaches (print-statement tracing vs. interactive debugger with breakpoints) and assign pairs to argue for each strategy. Pairs switch positions, argue the opposing view, then synthesize a recommendation that accounts for context and trade-offs.

Explain common debugging strategies and tools.

Facilitation TipDuring the Structured Academic Controversy, assign roles explicitly so students practice defending one strategy before synthesizing the best approach together.

What to look forProvide students with a small, buggy Python script and a specific error message. Ask them to use a debugger to identify the line of code causing the error and explain, in writing, why it is incorrect.

AnalyzeEvaluateCreateSocial AwarenessRelationship Skills
Generate Complete Lesson

A few notes on teaching this unit

Teach debugging like a protocol, not a talent. Model your own thought process aloud when errors occur in front of the class, showing how to pause, hypothesize, and test. Avoid letting students feel shame around bugs; instead, celebrate the moment a bug is found and fixed. Research shows that students learn debugging faster when they work in pairs and explain their reasoning to peers.

Students will move from random guesses to structured diagnosis by reading error messages, using debuggers, and documenting their steps clearly. By the end, they should articulate their debugging strategy before changing any code.


Watch Out for These Misconceptions

  • During Bug Hunt, watch for students who glance at errors and immediately guess fixes without reading the full message.

    Require students to copy the error message verbatim and circle key terms before discussing, using the activity’s printed script sheets to ground their observations.

  • During Rubber Duck Debugging, watch for students who rush to fix the bug without explaining their process aloud first.

    Use a timer to enforce full explanations, then ask the ‘duck’ to repeat the explanation in their own words to confirm understanding.

  • During Gallery Walk, watch for students who focus only on syntax errors and ignore logic or runtime issues in the bug reports.

    Provide a prompt card asking them to categorize each bug type before annotating, using the gallery’s printed error categories as a scaffold.


Methods used in this brief