CSE 15L, Fall 2009

Scientific Debugging

Example Lab, Notes, and Reports


The directions for writing collaborative lab notes and individual lab reports are intended to be sufficient for doing good-quality work in CSE 15L, but the following files for a fictitious "Lab X" (instead of, say Lab 1) are also provided to give you an idea what we expect:

Example.java
the code for Lab X, by Patricia Shanahan
notes X ddahlstr mpartner
lab notes written by Dana Dahlstrom and "Mysterious Partner"
report X ddahlstr (failure 1)
report written by Dana Dahlstrom about the first failure in Lab X
(in a purely narrative style)
report X ddahlstr (failure 2)
report written by Dana Dahlstrom about the second failure in Lab X
(with labels between paragraphs indicating the steps)

The code for what we're calling "Lab X" is from the article Debug Strategy by Patricia Shanahan. Don't worry if you don't understand all the details—for example, if you don't know all about the primitive types and bitwise operators in Java, or the Sieve of Eratosthenes—but do ask us if you're curious!

Note also the approach shown in these notes and reports is not the only, nor even necessarily the best, way to solve the problems in this code. In fact, the approach Shanahan describes in Debug Strategy is probably simpler and more generally applicable. In any case the primary purpose of the example notes and reports is to show how notes and reports should look. (This paragraph is Dana's excuse for what Shanahan calls the "aha" approach.)

In this example lab, and in general, you may see opportunities for improvement in ways other than fixing a failure, such as making the code more readable, more efficient, or just more aesthetically pleasing. You can make note of this, but in this class please don't make those changes: we're restricting our attention to debugging, and if you're not fixing a failure, you're not debugging! In general, make the smallest change you can to fix each failure. Each failure encountered in this example can be fixed by adding a single character to the source code!


Valid XHTML 1.0 Strict Valid CSS!