A Guide to Debugging
Author: Zoe Plaxco

## A. Introduction to Debugging

We have discussed why testing is important and how to do it efficiently, but what do we do when we have found the method where the bug is, but everything looks fine? We are now going to walk through the most important tool we have access to in cs61b - the debugger. This is a tool built into which allows you to step through your code line by line, providing a visual layout showing you the values of every variable at that moment in the code (using the Java Visualizer).

## B. Running the Debugger

Next, try right clicking your breakpoint (on the red dot). A small dialog should appear with a section for a "Condition". Try putting in a condition for a specific variable (such as f==1). See how the debugger acts differently!