tutorial: measure coverage to improve your unit tests
- In the article "Test Infected"
example library for handling Money is used to demonstrate the art of
Unit Testing with JUnit. The source to the Money library also ships
as an example with the standard JUnit distribution. The 22 tests
developed for the Money Library test most of the code in the library,
but not all of it. Which parts of the library weren't tested? How
would you go about finding out?
Coverage Analysis lets you see which parts of your application code
are being tested by your unit tests, and which parts aren't being
tested. You can then use this info to improve your tests and catch
The tutorial at http://www.thecortex.net/clover/tutorial/index.html
shows you how to measure the coverage of the Money Library tests, and
then improve the tests based on the results.