Testing Tools
Originally posted 2005-08-25 07:09:56
While at JavaOne last June, I wandered past Cenqua’s booth. The brochure for Clover caught my eye, so I spent some time chatting with one Cenqua’s reps about it. I took the brochure, stuffed it into my backpack, and didn’t really think much about it again.
Until the other day, as we talked about how to get better at writing solid code. We have begun to infuse our development with JUnit tests, and I wanted to see how well we were doing. So, I downloaded a trial of the Ant version of Clover, followed the steps to insert it into our build process, generated an HTML report . . . and sat agog. I’ve got to buy this tool.
Before I reveal anything, realize that our code base has been growing for about 5 years, and we’ve only recently introduced JUnit. Also, not all our developers have jumped on the JUnit bandwagon yet. Don’t judge us too harshly.
Clover revealed that 2.9% of our code undergoes JUnit testing. Ouch. Clover also shows coverage percentages by Conditionals (1.4%), Statements (3.1%), and Methods (5.4%). It shows coverage by packages (showing red and green bars), and lets you drill into packages to see breakdowns by class. You can then drill into each class to see its source code, marked up to show what lines are and aren’t run. This is tremendous.
We can now, as a team, set goals for JUnit test coverage, and I can measure and monitor progress. That is, I’ll be able to once we buy this tool. Gotta go talk to the boss . . . .
(Note: I’m not affiliated with Cenqua, this is not a paid advertisement, and I get no kickbacks whether or not you follow the links or buy the tool)