File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Coverage Testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Coverage Testing" Watch "Coverage Testing" New topic

Coverage Testing

peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
I'm posting this as a reminder of the benefits of coverage testing.

I've spent a lot of time on my LockManager class, tested it with 10 times as many threads as records and a 100 step manual test plan. It worked flawlessly, but I noticed while looking at the coverage stats that a 2 line piece of code was not being executed. I set up a test to ensure that code got run and found a subtle but deadly bug relating to a client crashing while it was waiting to aquire a lock. The fix involved moving one line of code in another method 3 lines lower.

I use the program Emma for coverage testing, its free, works well and is easy to use, it has a few bugs related to the use of System.exit, and I can't figure how to use the -D option to set headless mode, but otherwise seems quite solid.
I agree. Here's the link:
subject: Coverage Testing
It's not a secret anymore!