Byte by Byte › Book 1: Computer Basics › Chapter 10: Bugs and Debugging
Chapter 10: Bugs and Debugging
You will learn: what a bug is, and the four steps to find and fix one.
🌟 The Adventure
The Queen of Memunic had a special job for the friends. "Bleep must deliver my party invitations to the Post Box. Can you write his instructions?"
"Me! Me! Let me do it!" Noodles bounced up and down. He looked at the map quickly and wrote:
→ ↑ ↑ →
Bleep beeped happily. "FOLLOWING INSTRUCTIONS!" He rolled one square right. Then one square up... SPLASH! He rolled straight into the pond.
Bleep's antenna poked out of the water, dripping. "BLUB. INSTRUCTIONS FOLLOWED. INVITATIONS... WET."
Noodles' ears drooped. "I ruined everything. I'm a terrible programmer."
Simbha lay down beside him and wrapped him in his soft mane. "No, little one. You made a mistake. Every programmer makes mistakes. The important thing is what you do next."

💡 Learn With Memoon
What is a bug?
A mistake in a computer's instructions is called a bug. When there's a bug, the computer does something we didn't want, like rolling into a pond!
A famous story tells of a real moth found stuck inside an early computer in 1947. The team taped it into their notebook. Programmers still use the word "bug" for mistakes today.
What is debugging?
Finding and fixing bugs is called debugging. All programmers debug, even the very best ones. Mistakes are a normal part of learning.
The four debugging steps
- Test: follow the instructions and watch what happens.
- Find: go through the steps one by one. Find the exact step where things went wrong.
- Fix: change that step.
- Test again: follow the fixed instructions to make sure they work now.
Common kinds of bugs
| Bug | Example |
|---|---|
| A wrong step | ↑ written where it should be → |
| A missing step | Forgetting "peel the banana" |
| Steps in the wrong order | Shoes before socks |
| An extra step | One arrow too many |
💡 Memoon's tip: Don't rub everything out and start again. Look for the one step that went wrong. Usually, most of your instructions are already right!

✍️ Try It Yourself
Activity 1: Debug Bleep's path (No computer needed)
Here is the map. is Bleep. is the Post Box. trees and the pond block the way. squares are safe.
| Col 1 | Col 2 | Col 3 |
|---|
Row 1
Row 2
Row 3
Noodles wrote: → ↑ ↑ →
- Test: put your finger on Bleep and follow each arrow. Where does he end up?
- Find: which step is the bug?
- Fix: write the correct instructions.
- Test again: follow your fixed instructions with your finger.
Activity 2: Debug Kachui's river (No computer needed)
Look back at the Whirly River map in Chapter 8. Someone wrote these steps for Kachui: ↑ → ↑ ↑ → ↑
Follow them with your finger. Which step makes Kachui fall into a whirlpool? Fix it.
Activity 3: Debug the recipe (No computer needed)
Find the bug in these instructions for making a glass of lemonade.
- Fill a glass with water.
- Drink it.
- Squeeze a lemon into the glass.
- Add a spoon of sugar and stir.
Activity 4: Grown-up's secret bug (No computer needed)
Ask a grown-up to write simple instructions for drawing a smiley face, with one bug hidden inside. Follow them exactly. Can you find and fix the bug?
🎉 Memoon Solves It
Noodles sniffed and picked up the map. "Okay. Debugging. Step one: test." He put his paw on Bleep's square and followed his arrows. "Right. Up... splash! That's where it went wrong. Step two!"
"So the second step is the bug," said Memoon gently. "What should it be?"
Noodles looked carefully. "If Bleep goes right again, he stays on the path. Then up, up!" He crossed out his old arrows and wrote:
→ → ↑ ↑
"Step four: test again!" He traced it with his paw. Right, right, up, up. "It reaches the Post Box!"
Nimo blew a big bubble and floated Bleep out of the pond. The Queen gave Bleep a fresh pile of dry invitations.
"FOLLOWING NEW INSTRUCTIONS!" Right. Right. Up. Up. Clunk! The invitations dropped into the Post Box.
Everyone cheered. Noodles puffed out his fluffy chest. "I found a bug, and I fixed it! I'm a debugger!"
"You're a real programmer," said Simbha with a proud smile.
❓ Check Your Knowledge
A. Fill in the blanks
- A mistake in a computer's instructions is called a .
- Finding and fixing mistakes is called .
- After you fix a bug, you should again.
B. Put the debugging steps in order: Fix · Test again · Test · Find
C. True or False
- Only bad programmers make mistakes.
- When there's a bug, you should always start again from nothing.
- A missing step can be a bug.
D. Find the bug: "To post a letter: 1. Walk to the post box. 2. Drop the letter in. 3. Write the letter. 4. Put it in an envelope." What's wrong? Fix it.
📚 Word Bank
- Bug: a mistake in a computer's instructions.
- Debugging: finding and fixing bugs.
- Test: try out instructions to see if they work.
- Fix: change something so it works correctly.
Keep learning with Byte by Byte
Explore Book 1: Computer Basics. Find the ebook, purchase details and teaching slides on MemuniCity.
Comments
Post a Comment