Program Design and Debugging
Participation
Loading...

Export your exercise answers to use with another computer or browser.

Program Design and Debugging

This lecture showcases several debugging strategies applied to bugs added to the "Pokemon" program from lab. Students in the live lecture contributed several bugs and we walked through strategies for finding them. In particular, we focused on the following strategies:

  • Running the program and unit tests to find bugs
  • Using assertions to detect bugs earlier
  • Comparing program output to the sample correct file using the VS code diff tool
  • Using print statements to understand what the program is doing
  • Using a debugger to inspect variables and memory
  • Using a visual debugger to step through the program and find bugs
  • Using a debugger to track down the source of a segmentation fault or failed assertion
  • Setting conditional breakpoints to stop the program when a certain condition is met

These strategies are particularly helpful for more complex programs like the project 3 Euchre game.

Because this lecture is not available ahead of time, I've extended the participation deadline until Friday, May 30 at 11:59pm.

Updated Spring 2025

1: Debugging Demo
1.1 Not Started


Apologies for the abrupt end to the video - the lecture capture system cuts off a couple minutes early. The remaining part was just taking a look at the specific situation after setting the conditional breakpoint to identify the bug.

1.1 Participation Credit

Once you've watched the video, mark the item below to receive participation credit.

You've reached the end of this lecture! Your work on any exercises will be saved if you re-open this page in the same web browser.

Participation Credit
Make sure to sign in to the page, complete each of the exercises, and double check the participation indicator at the top left of this page to ensure you've earned credit.