EMMA (code coverage tool)
Encyclopedia
EMMA is an open source
toolkit for measuring and reporting Java
code coverage
. EMMA is distributed under the terms of Common Public License
v1.0.
EMMA is not currently under active development; the last stable release took place in mid-2005.
EMMA works by wrapping each line of code and each condition with a flag, which is set when that line is executed.
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...
toolkit for measuring and reporting Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
code coverage
Code coverage
Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. It is a form of testing that inspects the code directly and is therefore a form of white box testing....
. EMMA is distributed under the terms of Common Public License
Common Public License
In computing, the CPL is a free software / open-source software license published by IBM. The Free Software Foundation and Open Source Initiative have approved the license terms of the CPL....
v1.0.
EMMA is not currently under active development; the last stable release took place in mid-2005.
EMMA works by wrapping each line of code and each condition with a flag, which is set when that line is executed.
Features
- 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.
- it is possible to dump or reset coverage data remotely and without a JVM exit.
- does not require access to the source code and degrades gracefully with decreasing amount of debug information available in the input classes.
- 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.
- 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).
Alternatives
- CloverAtlassian cloverClover is a Java Code Coverage Analysis application developed by Atlassian. Although Clover is a commercial product, it is freely available to open source projects and non-profit institutions....
— a commercial alternative - Cobertura — an open-source alternative
EMMA-based tools
- Intellij Idea Plugin — Includes code coverage support from its own and an EMMA plugin
- NetBeans Code Coverage Plugin — Visualizes code coverage by coloring sources in the NetBeansNetBeansNetBeans refers to both a platform framework for Java desktop applications, and an integrated development environment for developing with Java, JavaScript, PHP, Python, Groovy, C, C++, Scala, Clojure, and others...
IDE - Sonar EMMA plugin — Enables usage of EMMA analyses within the code quality management platform SonarSonar (software quality)Sonar is an open source software quality platform. Sonar uses various static code analysis tools such as Checkstyle, PMD, FindBugs, Clover to extract software metrics, which then can be used to improve software quality.-Features:...
- Eclipse EMMA plugin
- Google CodePro AnalytiX