< Return to Video

CS Fundamentals: Debugging with the Step Button

  • 0:20 - 0:25
    All computer scientists, no matter how
    experienced they are, run into errors or
  • 0:25 - 0:27
    something they need to fix.
  • 0:27 - 0:31
    This is where debugging comes in. Debugging is just a
  • 0:31 - 0:35
    word that means finding and fixing errors in
    a program and the first step towards fixing
  • 0:35 - 0:41
    errors is to find them. Most puzzles have
    a step button below the play space that
  • 0:41 - 0:46
    you can use to hunt for problems. If your
    program doesn't work, press the "step"
  • 0:46 - 0:51
    button, and see what happens. Does the
    character take action in the right way?
  • 0:51 - 0:56
    If everything looks good with the first
    block of code, press the step button
  • 0:56 - 1:01
    again. How does everything look? Is it
    still running right? Keep going through
  • 1:01 - 1:05
    your code, line by line, until you find
    the first place where things go wrong.
  • 1:05 - 1:08
    What happened? What was supposed to
    happen?
  • 1:08 - 1:13
    What does that tell you? In this puzzle I get
    to the last line of code and don't reach
  • 1:13 - 1:19
    the goal. What happened? I got to the end
    of my code without solving the puzzle.
  • 1:19 - 1:25
    What was supposed to happen?
    I need to go forward one more step.
  • 1:25 - 1:30
    What does that tell me? It tells me I need to drag
    out one more of these blocks and attach
  • 1:30 - 1:37
    it to the end, before I click run. Tada! That's how you debug a program.
Title:
CS Fundamentals: Debugging with the Step Button
Description:

more » « less
Video Language:
English
Team:
Code.org
Project:
CSF '21-'22
Duration:
01:50

English subtitles

Revisions