Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cobertura vs clover [closed]

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

like image 472
Marcin Michalski Avatar asked Feb 02 '11 07:02

Marcin Michalski


People also ask

Why is cobertura code covered?

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.

Is cobertura open-source?

Cobertura is an open-source tool for measuring code coverage. It does so by instrumenting the byte code.

What is cobertura coverage report?

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.


2 Answers

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.

like image 194
James Woods Avatar answered Oct 22 '22 20:10

James Woods


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

like image 43
wolfcastle Avatar answered Oct 22 '22 21:10

wolfcastle