EMMA vs. Cobertura for Code Coverage
I'm looking to add code-coverage reporting to AppFuse. The two open source libraries I know of to do this are EMMA (CPL) and Cobertura (ASL). Which one is the better library to use? Both projects seem to be actively developed - and there are AppFuse HowTos for both, so the decision making process is a bit difficult.
Any insights into why one tool (or project) is better than the other is appreciated.
Posted by Todd Huss on February 04, 2006 at 01:35 AM MST #
Cobertura is based on JCoverage and uses ASM. The code is very clean and easy to understand. However, it injects a significant amount of bytecode which will have a significant impact on performance.
Emma does its own bytecode manipulation and the source code is not nearly as clean. It injects a small amount of efficient code. Instrumented bytecode will run almost as fast as regular bytecode. I also think it is faster at instrumentation, but I'm not sure about that. Emma does partial line coverage which I find useful.
They both generate nice reports, but I've heard that Cobertura's are nicer. If you want to dig into the source of the tool, go with Cobertura. Otherwise, I'd recommend Emma.
Posted by Michael Slattery on February 04, 2006 at 03:17 AM MST #
Posted by Aaron Korver on February 04, 2006 at 05:02 AM MST #
Posted by Karsten Voges on February 04, 2006 at 06:12 PM MST #
FYI - the license for Cobertura is mostly GPL, only the ant tasks are ASL.
Based on the licenses I'd lean towards EMMA but that is just my $0.02 :-)
Posted by Bill Dudney on February 06, 2006 at 04:55 PM MST #
Posted by JiaYun on February 09, 2006 at 05:33 PM MST #
Posted by McGinley on February 22, 2006 at 06:12 AM MST #
Posted by Tim Azzopardi on July 30, 2006 at 07:02 PM MDT #
i like cobertura's line counters, that's very helpful in its own right, and i also like emma's indication that some conditions on a line have not been evaluated (shows where logical short-circuits always fired, preventing testing of some conditions)
while having all together would be great, my preference is emma.
Posted by dave goldstein on September 13, 2006 at 02:47 PM MDT #
Posted by The Wabbit on October 14, 2007 at 02:32 PM MDT #
Posted by rjohnst on February 09, 2009 at 11:49 PM MST #
Posted by hardlyb on September 27, 2009 at 08:21 AM MDT #
Posted by jrang on October 05, 2009 at 12:11 PM MDT #