1

For using Emma we'll first instrument the jar using Emma. During that time em metadata files will get generated and when you run the JUnit test cases over the instrumented jars ec files will get generated. Which is used for generating the coverage report.

My question is we are not specifying the path to the em files when we are running the the test cases, so how it is able to generate the ec files? also I have heard Emma uses a port while running. What is that port ?

2 Answers 2

1

Andrew, by default EMMA is using current folder to look for coverage.em file. I don't believe it is listening on any TCP ports, I did a quick scan trough EMMA source code and couldn't find any references to sockets. It is only using URLs for loading class files from the classpath for instrumentation.

1
  • could you please spend some time accepting an answer, if It has cleared your doubt ? ;) Nov 20, 2011 at 9:17
1

Emma uses a feature called bytecode manipulation during its instrumentation phase. If you open up the instrumented class files in a decompiler, you'll notice that it would've introduced several additional lines of code.

It is this additional code that does the reporting. It will be something as simple as a simple log indicating that the code at that particular line number has executed.

When you generate the reports, emma uses the ec file to generate a human readable format of the report.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.