Home›Lesson Plans›Computer Science›Program Development · Grade 8

The Debugging Process

Eighth graders learn that debugging is a process, not luck, from reproducing a bug and locating it to fixing it and testing the fix, and put the steps in order.

Grade 8The Debugging Process55 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Reproduce a bug.
  • ✓Locate the cause.
  • ✓Fix and test.
  • ✓Order the steps.
Essential Question

Debugging is a skill, not luck. What are the orderly steps that take you from “it doesn’t work” to a fix you can trust?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Put in Order · Interactive

Order the Steps

Project this and put the debugging steps in order — tap each step from reproducing the bug to testing the fix.

🐛 Put the debugging steps in orderTry it
Tap the steps in order, starting with reproducing the bug.
The Lesson · Explicit teaching

55 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — It Doesn't Work!

5 min

Your program runs but gives the wrong answer. Guessing wastes time. What is a smart, orderly way to track down the bug?

👩‍🏫 Teacher Moves

  • Show a buggy result.
  • Ask how to find it.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Share.
  • Get ready.
2

Use — Order the Steps

12 min

Students put the debugging steps in order.

👩‍🏫 Teacher Moves

  • Send students to Order the Steps.
  • Order the steps.
  • Name each one.

🎒 Student Actions

  • Order.
  • Say.
  • Note it.
3

Modify — Find the Bug

13 min

Students debug a small program.

👩‍🏫 Teacher Moves

  • Read a short buggy program.
  • Locate the error.
  • Explain the cause.

🎒 Student Actions

  • Read.
  • Locate.
  • Explain.
4

Create — Debug Log

15 min

Students build a debugging log.

👩‍🏫 Teacher Moves

  • Describe a bug.
  • Record each step you take.
  • Note the fix and test.

🎒 Student Actions

  • Describe.
  • Record.
  • Note.
5

Reflect — Fix It, Then Prove It

5 min

Students reflect on testing the fix.

👩‍🏫 Teacher Moves

  • Why reproduce a bug first?
  • Why test after fixing?
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
2-AP-13

Systematically test and refine programs.

CSTA
2-AP-17

Use a process to find and correct errors.

CSTA
2-AP-19

Document a program to make debugging easier.

ISTE
5d

Troubleshoot problems methodically.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Step cards with icons.
  • Sentence frame: “First I ___ , then I ___ .”
  • Order two steps at a time.

Support & Access

IEP / 504
  • Start with 'reproduce the bug'.
  • Debug one example together.
  • Add one step at a time.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Apply the process to a real bug.
  • Add print statements to locate it.
  • Write a test that catches the bug.
Materials

What to gather

  • 📽️Projector / board
  • 🖼️Debug-step cards
  • 💻Order the Steps
  • 🐛Sample buggy programs
  • ✏️Pencils
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

bugan error that makes a program behave wronglydebuggingthe process of finding and fixing bugsreproduceto make a bug happen again on purposetraceto follow code step by step to find an errorroot causethe real reason a bug happenstest casean input used to check a program's behaviorregressiona new bug caused by a changebreakpointa spot where you pause code to inspect it
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What is the first step in debugging?
Reproduce the bug, so you can see it happen reliably and know when you have fixed it.
QUESTION 2
Why fix the root cause instead of the symptom?
Fixing only the symptom leaves the real problem in place, so the bug (or a similar one) comes back.
QUESTION 3
Why test after fixing a bug?
To prove the fix actually works and that your change did not break something else.

Create: a debug log.

Have students describe a bug, record each step they take to track it down, and note the fix and the test that proves it, building a habit of orderly debugging. A printable debugging worksheet is in the Computer Science library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 The Debugging ProcessFlip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 The Debugging ProcessQuiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ The Debugging ProcessPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: breakpoint, bug, debugging, regression, reproduce, root cause, test case, trace
  1. to follow code step by step to find an error
  2. the real reason a bug happens
  3. a new bug caused by a change
  4. a spot where you pause code to inspect it
  5. to make a bug happen again on purpose
  6. an input used to check a program's behavior
  7. an error that makes a program behave wrongly
  8. the process of finding and fixing bugs

Part B · Show what you learned

  1. What is the first step in debugging?
  2. Why fix the root cause instead of the symptom?
  3. Why test after fixing a bug?
Answer key — Part A: 1) trace · 2) root cause · 3) regression · 4) breakpoint · 5) reproduce · 6) test case · 7) bug · 8) debugging
Part B: 1) Reproduce the bug, so you can see it happen reliably and know when you have fixed it. 2) Fixing only the symptom leaves the real problem in place, so the bug (or a similar one) comes back. 3) To prove the fix actually works and that your change did not break something else.