[an error occurred while processing this directive]
Brown CS // CS190 Home // Assignments // Debugging

Debugging Assignment

Due: Wednesday, March 21, 2007

This assignment is intended to give you a chance to demonstrate that you know how to step through code and verfiy code execution. Use the method described in Chapter 4 from Writing Solid Code.

  1. Download the Minesweeper source, decompress it (tar -xzf minesweeper.tgz), and make an executable.
  2. Re-read Maguire's description of how to step through code.
  3. Set up to record your debugging session (use "script" or cut-and-paste). You can use gdb or totalview, but you must do it in a mode where you can record a transcript.
  4. Step through the method MineField::populate in the debugger (this method is called every time you start a new game, after selecting the field size). Follow the guidelines from Writing Solid Code chapter 4 on how to do this. Check variable values and other state information before and after execution of each line and verify that the line did what it should. Be sure to step through all the lines of code, even if that means fixing some of the errors as you go along. (It is only necessary to step through the populate function and not the subfunctions called by it.)
  5. Add concise comments to your script explaining what bugs you found and how you fixed them.
  6. Hand in your debugger transcript.

The rubric for this assignment is available here.

[an error occurred while processing this directive]