# Debugging Strategies > Eighth graders learn to debug like a pro — with a systematic process instead of random guessing. Reproduce the bug, narrow down where it happens, form a… **Computer Science** | **Grade 8** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g8-cs-debugging.html* Eighth graders learn to debug like a pro — with a systematic process instead of random guessing. Reproduce the bug, narrow down where it happens, form a hypothesis, change one thing, and verify. They order the process, then debug a broken program. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Follow a **debugging process**. - Reproduce and **isolate** a bug. - Change **one thing** at a time. - Verify the fix. How do you find and fix a bug systematically? ## Order the Debugging Process Project this and have students put the debugging steps in order. ## 50 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — It Worked Yesterday! What do you do when your program suddenly breaks? #### 👩‍🏫 Teacher Moves - Show a buggy program. - Ask how to start. - Set the goal. #### 🎒 Student Actions - Look. - Guess. - Get ready. ### Use — Debugging Strategies Students use the process. #### 👩‍🏫 Teacher Moves - Send students to Order the Debugging Process. - Order the steps. - Note change one thing at a time. #### 🎒 Student Actions - Order. - Say. - Note it. ### Modify — Narrow It Down Students modify. #### 👩‍🏫 Teacher Moves - Add a print to inspect a value. - Comment out a section. - Isolate the broken line. #### 🎒 Student Actions - Print. - Comment. - Isolate. ### Create — Fix & Verify Students create. #### 👩‍🏫 Teacher Moves - Fix a provided bug. - Test the fix. - Check nothing else broke. #### 🎒 Student Actions - Fix. - Test. - Check. ### Reflect — Reflect Students close. #### 👩‍🏫 Teacher Moves - Name the first step. - Say why change one thing. - Complete the exit ticket. #### 🎒 Student Actions - Name it. - Say. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Systematically test and refine programs. Document programs to make them easier to follow. Systematically identify and fix problems. Test and refine solutions. ## One lesson, every learner ### Multilingual Learners - Debug-step cards. - Frame: “what, where, why, fix, check.” - Think-aloud a fix. ### Support & Access - Use 3 steps. - Fix one simple bug. - Use a checklist. ### Stretch & Extend - Use a debugger’s breakpoints. - Write a bug report. - Add tests to prevent regressions. ### What to gather - 📽️Screen / board - 🐛Debug-step cards - 💻Order the Debugging Process - 🐍A buggy program - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **bug**: an error that makes a program misbehave - **debug**: to find and fix bugs - **reproduce**: to make the bug happen again - **isolate**: to narrow down where it occurs - **hypothesis**: a guess about the cause - **test**: to check if a change worked - **verify**: to confirm it is truly fixed - **regression**: a fix that breaks something else ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: debugging strategies. Have students list the debugging steps in order. A printable debugging worksheet is in the Computer Science library. ## Check your understanding **1. What does “bug” mean?** - a guess about the cause - a fix that breaks something else - an error that makes a program misbehave *(correct)* - to confirm it is truly fixed “bug” means: an error that makes a program misbehave **2. Which word means: “to find and fix bugs”?** - debug *(correct)* - regression - isolate - verify “debug” means: to find and fix bugs **3. What does “reproduce” mean?** - to make the bug happen again *(correct)* - a guess about the cause - to check if a change worked - to confirm it is truly fixed “reproduce” means: to make the bug happen again **4. Which word means: “to narrow down where it occurs”?** - regression - debug - isolate *(correct)* - bug “isolate” means: to narrow down where it occurs **5. What does “hypothesis” mean?** - to narrow down where it occurs - to check if a change worked - a guess about the cause *(correct)* - to make the bug happen again “hypothesis” means: a guess about the cause **6. Which word means: “to check if a change worked”?** - reproduce - test *(correct)* - bug - isolate “test” means: to check if a change worked ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g8-cs-debugging.html All lessons: https://lessonplans.k12academics.com/