Understand the problem

Have a clear idea of what the class is supposed to do. To test your understanding, make sure that

  1. you can state the class's purpose in one simple English sentence (say, at most 25 words, preferably 10).
  2. if somebody else had written the program, you could distinguish correct behavior from incorrect behavior.

If you're sitting at the computer, you can write down the statement of purpose in a Java comment, e.g.

/**
 *  Date: represent a date in terms of year, month, and day.
 *
 * @author Stephen Bloch
 * @version 17, Feb. 20, 2009
 */
Note that I'm also using javadoc tags to indicate the author and version; following javadoc format makes it easy to automatically produce documentation (in BlueJ, find the control labeled "Source Code" in the upper-right corner of the class editor window, and switch it to "Documentation". It will automatically generate a Web site of documentation for the whole class, with hot-links and formatting and everything.)


Last modified: Fri Feb 20 09:43:06 EST 2009
Stephen Bloch / sbloch@adelphi.edu