← Back to course
Code Crew G3 / Week 06 / Tuesday
2/6
Week 06 Β· Debugging

Tuesday

// Finding the broken step

Tuesday: Bug Hunt

Rocket wrote two step lists for Nova to test. Nova acts out the sandwich steps as a hologram. The hologram sandwich falls apart!

"That is silly," Rocket says with a laugh. "Something is out of order." Raven asks, "Which step came too soon?"

Nova says, "Read each step. Find the one that breaks the plan." Let's help them find the bug in each list.

Each set of steps has ONE bug. Circle it. Then write the fix.

(A) MAKE A SANDWICH
    1. Get bread
    2. Add banana slices
    3. Eat the sandwich
    4. Put two slices together
Bug is step ____. Fix:
(B) GO TO SCHOOL
    1. Get out of bed
    2. Walk to school
    3. Eat breakfast
    4. Put on shoes
Bug is step ____. Fix:
Try Without Paper
Tell a parent your morning routine, but mix up ONE step on purpose.
Can they spot the bug?

Three Kinds of Bugs

Most bugs are one of three kinds. A step can be in the WRONG ORDER. A step can be MISSING. Or a step can be WRONG.

Kind of bugExample
Wrong orderShoes before socks
Missing stepPouring water with no cup
Wrong stepTurning left instead of right
NAME THE KIND OF BUG
  • Read the question.
  • Tap your answer.
Steps: get in the car, drive away. What kind of bug?
Steps: dry your hands, then wash your hands. What kind of bug?
Goal: clap 3 times. Code: REPEAT 3 TIMES: stomp. What kind of bug?
Steps: open the book, close the book, read a page. What kind of bug?
Goal: water the plant. Steps: fill the can, walk to the plant. Which action is missing?
Goal: count to 5. Code: say 1, say 2, say 4, say 5. Which number is missing?
Goal: turn right at the corner. The code says turn left. Which word is the bug?
StatementTrue or false?
A missing step is a kind of bug.?
Steps in the wrong order can cause a bug.?
If every step is there, there can be no bug.?
Changing left to right can fix a wrong step bug.?
WHY THIS EXERCISEA program can have every step and still be wrong.
FIX THE HAND WASHING STEPS
  • ?Turn on the water
  • ?Wet your hands
  • ?Rinse your hands
  • ?Dry your hands
  • ?Rub with soap
WHY THIS EXERCISEPutting steps back in order fixes a wrong order bug.
Try it
Write three steps for caring for a plant.
Hide one bug: wrong order, missing or wrong.
Can a grown-up find it and name the kind?

Quick Check

DEBUG THE LETTER STEPS: PUT THEM IN ORDER
  • ?Write the letter
  • ?Drop it in the mailbox
  • ?Fold the letter
  • ?Seal the envelope
  • ?Put the letter in the envelope
WHY THIS EXERCISEA bug is often a step in the wrong place. Debuggers fix the order so each step has what it needs.
← Monday