Introduction to Tools and Techniques in Computer Science

Introduction

Franklin Bristow

Introduction

You’ve been writing code, and hopefully doing OK.

But, uh, yeah. Gosh. Our code crashes a lot. Like a lot a lot. Sometimes this is because we forgot to check for values we weren’t expecting or didn’t even think could happen. Sometimes it’s because our mental model of what our code does isn’t right. Sometimes it’s because we inverted a conditional statement.

Regardless of the reason, trying to figure out why your code is crashing is an important part of fixing your code.

This week we’re going to take a look at what we’re trying to accomplish when we’re doing debugging and different strategies for doing debugging. We’ll also take a look at a couple of specific tools, and try to get a handle on the keywords that are used to describe how the tools are used.

By the end of this week you should be able to:

  • Describe what debugging allows you to observe about a running program.
  • Use log-based debugging to identify a problem with code.
  • Use a visual debugger to set breakpoints, inspect values, step through a running program, and make observations about a program when it crashes.
  • Use a command-line debugger to set breakpoints, inspect values, step through a running program, and make observations about a program when it crashes.