The procedure is quite simple. Suppose you are going to get the coverage of a binary which obviously contains hundred of jars. First, you need to prepare a list of jars which requires to be instrumented. The list can be prepared easily in *nix environments as follows.
xargs -n 1 $JAVA_HOME/jre/bin/java -cp emma.jar emma instr -m overwrite -cp < jarlist.txt
This inserts tracking code to the jars listed in jarlist.txt.
Now, you should restart your application and Emma starts to gather coverage data. If you have an automated functional test suite, run it over the instrumented binary or test the product manually.
After completing the testing, stop your application. Now, we need to generate the coverage report. Issue the following command.
java -cp emma.jar emma report -r html -in coverage.em,coverage.ec
This generates an html report as shown below.
Currently, we are in the process of developing a selenium based automation framework and we use this test coverage mechanism to find out the components which require more tests.