Skip to content

Commit

Permalink
Revised error analysis step.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko authored Feb 27, 2018
1 parent 0518ae0 commit 8675f35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Roboto/debug.roboto
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ STRATEGY debug()
FOR EACH 'line' IN 'outputLines'
# First, let's make sure the line executed. You want to be sure that this is actually the source of the wrong output. You can check this by inserting a logging statement, or setting a breakpoint on the line.
IF the program executed 'line'
# Is anything about this line of code causing the failure? If so, you found the bug!
IF 'line' is has an error in it that causes the failure you're debugging
Analyze the line to determine its role in the overall behavior of the program
# Check for errors such as the wrong function being called, the wrong argument being passed to a function, the wrong variable being referenced, or a wrong operator being used
IF any part of 'line' is inconsistent with its purpose
# You found the bug
RETURN 'line'
# If the output statement is not wrong, perhaps the line was not supposed to execute at all?
IF 'line' was not supposed to execute at all
Expand Down

0 comments on commit 8675f35

Please sign in to comment.