This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
Consider Paul's rocket mass heater.
subject: Coverage Testing
Similar Threads
Brain Dead Lock Testing
Estimating Test Development and Test Coverage
Any good opensource code coverage tools?
tips for procedural cobol programmer to do java testing
Unit test patterns with Hibernate