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 11 Comments
Search This Site
Recent Entries
- Raible Road Trip #13
- The good ol' Job Hunt
- How to use GWT 2.0 with Maven and Generate SOYC Reports
- JSON Parsing with JavaScript Overlay Types in GWT
- A Fun Father's Day at Great Sand Dunes
- Going to the Great Sand Dunes for Father's Day
- Implementing OAuth with GWT
- Enhancing Evite.com with GWT and Grails
- 2nd Row at Red Rocks and Elephant Rock Ride
- Creating a Facebook-style Autocomplete with GWT
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 #
Posted by rjohnst on February 09, 2009 at 04:49 PM MST #