Questions tagged [emma]

EMMA is an open-source toolkit that measures and reports the percentage of Java code covered by unit tests.

EMMA features at a glance:

  • 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.
  • Starting with build 2.1.5320 it is possible to dump or reset coverage data remotely and without a JVM exit.
  • 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 individual .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).

Useful Links:

274 questions
11
votes
1 answer

Is there a tool for converting the Emma XML reports to Cobertura XML format?

I am using a code coverage tool that can only generate Emma XML report, while what I need is Cobertura or gcov format. Does there already exist some tool for doing the conversion? If not, I'm afraid I must do it myself.
tomsheep
  • 253
  • 1
  • 3
  • 7
9
votes
1 answer

Maven Emma coverage Report failed

Hi i want to generate emma report using maven.when i try to build report it gives this error. [ERROR] Failed to execute goal org.codehaus.mojo:emma-maven-plugin:1.0-alpha-3:instrument (default) on project point-repo: Execution default of goal…
Sajith Vijesekara
  • 1,324
  • 2
  • 17
  • 52
8
votes
3 answers

Why doesn't EclEmma cover syncronized(MyClass.class)?

I'm using EclEmma for coverage analysis. My Java code includes a synchronized(MyClass.class) {} block. EclEmma says it is only partially covered, event though I've got a unit test in which one thread gets access and another thread is blocked. Is it…
Roger C S Wernersson
  • 6,362
  • 6
  • 34
  • 45
8
votes
8 answers

How far do you take code coverage?

I've recently started using code coverage tools (particularily Emma and EclEmma), and I really like the view that it gives me as to the completeness of my unit tests - and the ability to see what areas of the code my unit tests aren't hitting at…
matt b
  • 138,234
  • 66
  • 282
  • 345
8
votes
2 answers

Emma code coverage, source file not found in sourcepath

To generate emma report I ran these command. 1. mvn install -Pwith-emma 2. java -cp %USERPROFILE%/.m2/repository/emma/emma/2.1.5320/emma-2.1.5320.jar emma report -r xml,html -in coverage.ec -in target/coverage.em After ran command I am able…
Dani
  • 113
  • 7
8
votes
3 answers

What are my alternatives for test code coverage on Android?

I know Android's Ant tooling comes with built-in Emma code coverage, but Emma's reports look more and more dated and cannot be easily integrated into other coverage reports or even Sonar, basically because Emma lacks a detailed XML reporting format.…
Thomas Keller
  • 5,933
  • 6
  • 48
  • 80
7
votes
2 answers

How can I use filter for emma when building Android test with ant?

I know how to use emma in ant when building my android test project but I can't find any tips on how to use filters when using the SDK. The emma website explains it when calling emma yourself but in the Android SDK build files emma is not called in…
Huupke
  • 1,158
  • 1
  • 13
  • 25
7
votes
2 answers

Partial EMMA code coverage in Scala Case Class for IntelliJ IDEA 10.5

I'm using IntelliJ IDEA 10.5 with the Scala plugin v0.4.1338 updated on August 14th, and Scala 2.9.0.1. I recently began using the EMMA test coverage utility in IDEA to generate coverage reports. I cannot determine why the constructor line of my…
alexsaintx
  • 505
  • 4
  • 7
7
votes
3 answers

IntelliJ 12 code coverage not working in editor for GWT Projects

I'm trying IntelliJ 12, and I can't manage to get the line colored (red, green, yellow) in the editors after running the tests with coverage. Did anybody noticed the problem or it's just me not being able to make it work?
Luigi R. Viggiano
  • 8,659
  • 7
  • 53
  • 66
7
votes
2 answers

adding 'emma' to Android ant build triggers "local variable type mismatch" exception

I am trying to run Emma on the tests for an Android project that is a combination of Java and C/JNI code. The build and tests work fine, but whenever I add emma, I get a mysterious exception. I'm using the Android SDK v20.1 and NDK r8b. The…
6
votes
1 answer

eclEmma - full code coverage on class header?

I have a class that starts with: public class GeneralID implements WritableComparable{ ... } And another that is: public class LineValuesMapper extends Mapper{ ... } All methods in…
Tiago Veloso
  • 8,513
  • 17
  • 64
  • 85
6
votes
1 answer

Eclipse EclEmma missed instructions

I'm using Eclipse-STS + EclEmma plugin to see coverage of my code. In all my abstract util classes (with only static methods) I see 3 missed instructions (Instructions Counter report) at the class definition line: No marker available at the left of…
madhead
  • 31,729
  • 16
  • 153
  • 201
6
votes
2 answers

Java test coverage: who covers what?

Is there a tool similar to emma, that reports which test covers a specific implementation ?
Bastl
  • 2,926
  • 5
  • 27
  • 48
6
votes
3 answers

How to export emma coverage to HTML in eclipse?

I'm using Eclipse Juno and I want to get Emma code coverage. Right now I am getting the coverage in coverage window of Eclipse. But what should I do if I want the full coverage in HTML format. Previously when I was using indigo, I was having an…
user1661985
  • 71
  • 1
  • 3
6
votes
2 answers

How can I remove/filter/ignore some package from Emma (code coverage)

I`m trying to remove some package from my report and having trouble. Could some one give me some help? I'm using EMMA in my ant process.