Writing Unit Tests

Overview

Software testing typically proceeds bottom-up, starting with unit-testing of individual modules, where a module might be a class or a collection of classes.  The JUnit framework (see www.junit.org) provides a convenient way to write automatic test scripts.

For this deliverable, you need to write JUnit test cases for some module in your project. You should strive to develop a thorough collection of tests, and your test cases should include at least ten (and possibly significantly more) calls to the assertXXX(…) methods provided by the JUnit framework.

Deliverable

The deliverable to hand in is a printout

·        The commented source code for your test cases

·        The Javadoc interface documentation for the software under test.

Grading

This deliverable is worth 30 points, awarded for

·        [10 points]        Good test coverage

·        [5 points]          At least 10 assertXXX(…) calls.

·        [5 points]          Clearly structured and well-written test case code.

·        [5 points]          Helpful comments in the test case code

·        [5 points]          Good Javadoc interface documentation for the software under test.