next up previous
Next: 1.6.1.4 Template Up: 1.6.1 The Design Recipe Previous: 1.6.1.2 Contract and Header

1.6.1.3 Examples

Each class should include a collection of sample inputs and corresponding outputs for each method. If the body of a method contains more than one control path (e.g. a conditional statement), the collection of examples should include at least one example for each control path. The examples for each method should be included in the main method for the class. In this way, each class can be tested without the support of a special programming environment like DrJava.



Corky Cartwright
2000-01-07