We are thinking about utilizing one of these tools in our development procedure. Our environment extensively uses mvn and eclipse.
Which one in your opinion is the best utility for checking test coverage? I realize that it may depend on the situation to determine when it is better to use cobertura over clover and vice-versa.
Thanks in advance
Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.
Cobertura is an open-source tool for measuring code coverage. It does so by instrumenting the byte code.
Simply put, Cobertura is a reporting tool that calculates test coverage for a codebase – the percentage of branches/lines accessed by unit tests in a Java project.
I have also tried Clover, Cobertura and Emma. We are now using Cobertura. It took me about a day to integrate Cobertura into our headless build, it produces the statistics we require and the eCobertura eclipse plugin is primitive, but useable and informative. There is a very nice Hudson plugin for Cobertura also.
We where previously using Emma. Emma with the EclEmma plugin is about equivalent to Cobertura/eCobertura. Emma integration into Ant is a fracton more complex and doesn't offer a complexity factor. The EclEmma plugin is nicer and more mature then eCobertura. The Hudson plugin is equivalent and as easy to configure. Our reason for moving away from Emma was that the code base has not been maintained for some years now and we where having problems as it is rendered useless if encounters code using Lombok.
I spent a week (in parallel with other tasks) playing with Clover and coudln't get it working. I asked around my colleagues, some with a lot of experience, and only one had heard of somebody getting Clover working in the build, and that was difficult.
As Cobertura provides everything that we required, is easy to work with and is free we saw no reason to spend money on Clover.
One distinction of note is that Cobertura does NOT currently support Java 7:
Cobertura & Java 7 support
Clover 3.1.x DOES support Java 7:
http://confluence.atlassian.com/display/CLOVER/Clover+3.1+Release+Notes
UPDATE: Cobertura 2.0.3 supports Java 7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With