0

Fix the bug

    1. 1Find
      the wrong block
    2. 2Change
      swap or take it out
    3. 3Test
      run it again

    Find, change, test

    Fixing a bug has three parts. Find the wrong block. Change it. Then run the program again.

  1. move right
    move right
    collect the star

    Swap the wrong block

    This program used to say move up. The robot missed the star. We swapped it for move right. Now it works.

  2. move down
    move down
    move down

    Add a missing block

    Sometimes a block is missing. The robot stops one square short of the flag. Add one more move and test again.

  3. Take out an extra block

    Sometimes there is one block too many. Tap the small x to take it out. Then run it to check.

  4. Always test

    A fix is only done when you test it. Press Run and watch. If it still goes wrong, look again.

For parents

Goal: Your child learns to fix a bug by swapping, adding or taking out a block, and then testing the program again.

  • Praise the testing, not just the fix. Running it again is what real coders do.
  • If a fix does not work, say: good, now we know one more thing. Look again.
  • Ask your child to tell you which kind of fix they made: swap, add or take out.

Away from the screen: Write simple directions to a toy hidden in the room with one mistake in them. Your child follows them, finds where they go wrong, fixes the note and tries again.

Coding · Bugs
Back to top