Friday February 03, 2006
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 in Java at Feb 03 2006, 05:16:35 PM MST 10 Comments
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
Search This Site
Recent Entries
- Jack's Mohawk
- LinkedIn Cuts 10% (a.k.a. The Journey is Over)
- Happy Birthday Abbie!
- Moving from Spring's XML to Annotations in AppFuse
- Free Maven Training in New Orleans on Election Day
- AppFuse Light ยป AppFuse, Maven Archetypes and Shared Web Assets
- Great Weekend in Montana
- Colorado Software Summit 2008 Wrapup
- RESTful Web Applications with Subbu Allamaraju
- Core Animation with Bill Dudney
Posted by Todd Huss on February 03, 2006 at 06:35 PM 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 03, 2006 at 08:17 PM MST #
Posted by Aaron Korver on February 03, 2006 at 10:02 PM MST #
Posted by Karsten Voges on February 04, 2006 at 11:12 AM 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 09:55 AM MST #
Posted by JiaYun on February 09, 2006 at 10:33 AM MST #
Posted by McGinley on February 21, 2006 at 11:12 PM MST #
Posted by Tim Azzopardi on July 30, 2006 at 01: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 08:47 AM MDT #
Posted by The Wabbit on October 14, 2007 at 08:32 AM MDT #