Debugging & Testing
📋 What it is
A bug is an error in code; debugging is finding and fixing it, and testing checks that code works.
🗣️ Coach says
Code rarely works the first time — and that's NORMAL. A BUG is a mistake that makes the program do the wrong thing. DEBUGGING is the detective work of finding and fixing it. TESTING (trying inputs and checking outputs) catches bugs. Great coders aren't people who never make bugs — they're great at finding them.
🧠 Memory hook
Bugs are normal. Debugging = find and fix. Testing = check it works.
😂 Giggle
What's a coder's favorite place to hang out?
Foo Bar!
😲 Whoa!
The term "bug" for a computer error goes back to 1947, when engineers found a real MOTH stuck in a computer and taped it into the logbook as "the first actual bug".
✅ Quick check: What is "debugging"?
Say your answer out loud first — then reveal.
The process of finding and fixing errors (bugs) in code so the program does what it should.
Debugging locates and repairs the mistakes that cause wrong behaviour.
🪄 Trick question: Does a good programmer write code that never has bugs?
Careful — think it through, then reveal.
No — everyone writes bugs; the skill is being good at finding and fixing them through debugging and testing.
Bug-free-first-try is a myth; debugging skill is what matters.
🧪 Try it! (2 minutes)
Take a simple wrong "recipe" (with a deliberate mistake) and debug it — find the step that's wrong and fix it.