RSS Feed for This PostCurrent Article

EclEmma and EMMA: Java Code Coverage Tool

I wrote few articles on code coverage in Java. EclEmma and EMMA are 2 excellent Java code coverage tools.

EclEmma is a free Java code coverage tool for Eclipse, available under the Eclipse Public License. Internally it is based on the great EMMA Java code coverage tool, trying to adopt EMMA’s philosophy for the Eclipse workbench:

  • Fast develop/test cycle: Launches from within the workbench like JUnit test runs can directly be analyzed for code coverage.
  • Rich coverage analysis: Coverage results are immediately summarized and highlighted in the Java source code editors.
  • Non-invasive: EclEmma does not require modifying your projects or performing any other setup.

The Eclipse integration has its focus on supporting the individual developer in an highly interactive way.

 

EMMA is an open-source toolkit for measuring and reporting Java code coverage. EMMA distinguishes itself from other tools by going after a unique feature combination: support for large-scale enterprise software development while keeping individual developer’s work fast and iterative.

As taken from the website,

  • EMMA can instrument classes for coverage either offline (before they are loaded) or on the fly (using an instrumenting application classloader).

  • Supported coverage types: class, method, line, basic block. EMMA can detect when a single source code line is covered only partially.

  • Coverage stats are aggregated at method, class, package, and “all classes” levels.

  • Output report types: plain text, HTML, XML. All report types support drill-down, to a user-controlled detail depth. The HTML report supports source code linking.

  • Output reports can highlight items with coverage levels below user-provided thresholds.

  • Coverage data obtained in different instrumentation or test runs can be merged together.

  • EMMA does not require access to the source code and degrades gracefully with decreasing amount of debug information available in the input classes.

  • EMMA can instrument individial .class files or entire .jars (in place, if desired). Efficient coverage subset filtering is possible, too.

  • Makefile and ANT build integration are supported on equal footing.

  • EMMA is quite fast: the runtime overhead of added instrumentation is small (5-20%) and the bytecode instrumentor itself is very fast (mostly limited by file I/O speed). Memory overhead is a few hundred bytes per Java class.

  • EMMA is 100% pure Java, has no external library dependencies, and works in any Java 2 JVM (even 1.2.x).

  • EMMA has plugins available for Maven, Eclipse and IntelliJ IDEA.


Trackback URL


Sorry, comments for this entry are closed at this time.