Wednesday, November 19, 2008

Emma - Free code coverage tool

Emma is an easy use open source code coverage tool. It has both the on-the-fly and offline instrumenting. Invoking can be done by ant task or command line operations.

I've tried the offline instrumentation with the following commands,

1. Instrument the class
java -cp emma.jar emma instr -m overwrite -cp My.jar

2. Running the application
Placed the emma.jar in the application classpath. Run the tests in the application.

3. Generating report
java -cp emma.jar emma report -r html -in coverage.em,

In order to understand the effectiveness of the code coverage, the following are needed,

1. List of cases/steps/features which are going to be tested
2. List of classes/jars under test which are instrumented
3. Result of the test
4. Coverage report

Read this article to know more about the coverage analysis.


raja's shared items

There was an error in this gadget

My "Testing" Bundle