Design recipe for Java classes, version 3

    Analysis and design (i.e. "decide what you want to do")

  1. Understand the assignment informally and write down a purpose statement for the class.
  2. Write a class sketch, specifying what kinds of information the class needs to "remember" and what its most important methods should do.
  3. Write examples of how your class will be used, with correct answers. This is a good time to create a testing class.
  4. Coding ("do it")

  5. Write a class skeleton
  6. For each method in the class,

      Analysis and design (i.e. "decide what you want to do")

    1. Understand what the method is supposed to do, and write down a purpose statement for the method.
    2. Write a contract for the method (if you didn't already do this in the class sketch).
    3. Write examples of how the method will be used (if you didn't already do this in the class sketch).
    4. Coding ("do it")

    5. Write a method skeleton
    6. Add an inventory to the method skeleton
    7. Fill in the Function Body
    8. Compiling and testing ("check that you did it right")

    9. Compile and syntax-check the class. Since the only things you've changed recently are in this one method, you should encounter error messages only in this one method.
    10. Style-check the class (ditto).
    11. Test and debug the method (it may be easiest to simply run all the test cases for the whole class).
  7. Compiling and testing ("check that you did it right")

  8. Do an integration test to make sure the methods (which have already been tested individually) work correctly together.

For the next elaboration of this, see version 4.


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