next up previous
Next: 1.5.2 An Extended Example: Up: 1.5.1 The Design Recipe Previous: 1.5.1.5 Body

1.5.1.6 Test

Each class C representing a data type definition1.3 should include a CTest method that evaluates each primitive operation for the data type on the sample data values defined for its input domain and other representative input values.

If the DrJava programming environment is not available, the main method for the class can be used instead of test. Alternatively, a tool like JUnit (see www.junit.org) can be used to run all of the test methods in a program. In fact, for large programs, tools like JUnit are essential to automate the testing process-which must be performed every time a program is modified.



Corky Cartwright 2003-07-07