Categories
java

Code Coverage Tools…

I am looking at unit test code coverage tools.  I heard a lot about Clover over the weekend at The Spring Experienece, but it’s not in my budget.  The next two tools that made it on my first page of Google results were Emma and Cobertura?  Does anybody have any opinions on any of these three tools?  Thanks…

6 replies on “Code Coverage Tools…”

At the Dallas NFJS, Scott Davis’ “Holistic Testing” talk went over Cobertura which I believe he said was forked out of Clover. Check your CD.

Erik, I have used both and so far I like Emma best because it has more strict rules for gathering the coverage data. You’ll find that there a couple of Eclipse plugins for doing code coverage too (some links at my blog http://jroller.com/page/aalmiray/?anchor=code_coverage_on_eclipse_eclemma)

You can find more on code coverage at Andy’s blog:
http://thediscoblog.com/2006/07/03/the-skinny-on-code-coverage/
http://thediscoblog.com/2006/03/05/copasetic-coverage-frequencies/

Thanks for the comments guys…

I guess there was no single winner so I’ll spend a few minutes looking at both.

Erik

I’ve used all three and have the following comments:
1) Clover is my top choice, however as you it’s not in my budget nor my client’s.
2) At the time of evaluation Cobertura had a Maven 2 plugin, Emma did not ( it may now).

One of the requirements I have is that the tool must run w/the build and not everyone on my team uses Eclipse, therefore Emma is my preference. I found that it fit the bill nicely.

Scott

I’ve used both emma and cobertura. My team spent 3 weeks getting emma to work on our project and then a few more weeks trying to figure out why we were losing results.
I got frustrated with the emma and spent a few hours in the evening getting cobertura setup for the same project and have been very pleased with not only the results, but the consistency of the results.
Our setup is strictly from ant and other ant tasks so I can’t comment on Eclipse integration or other niceties.
Unfortunately the mandate to use emma came from PHB’s that only read the docs and never took the time to evaluate the product. So, while I’m stuck with emma, I’d recommend cobertura.
best of luck.
-Jacobd

Leave a Reply

Your email address will not be published. Required fields are marked *