To enable Emma for a java project, right click the project and select Properties for
that project:
[javaProject]> Properties.
On the properties page, select The option Emma. A page with a checkbox and some text fields appears. Add a check in the checkbox and press Ok.
Once Emma is enabled for the project, two noticeable things happens. First, a folder named .emma appears at the root of the project. Secondly, the Emma jar gets added to the classpath of the project. Under the hood, all classes that exists for the project gets Emma monitoring code added to them. The emma jar needs to be added to the classpath of the project since once the class files get the extra monitoring code added, every time they are executed they need to have the required Emma classes on the classpath. All this is done automatically when the plugin is enabled. When it is disabled, the classpath is cleaned. You may or may not see the folder and the added classpath in the Package Explorer, depending on how your view filters are set.
Once Emma is enabled for a project, a small indicator symbol appears in the top left corner of the project, so that you can see which projects are monitored with a quick glance.
When Emma is enabled it constantly tracks the work environment for changes in the compiled sources so that it's always up to date. When any class is executed, Emma monitors the execution and saves the execution data.
Try running a class in a project where Emma is enabled. The coverage state should appear as decorations on each source file in the project.
Once you have created a coverage for a class you can view the exact report for that class by right clicking on the source file and selecting the Show coverage report from the Emma menu.
That's it! That's all you need to know to add code coverage as a tool to your toolset. Once you get started using it, it's a habit that's very difficult to live without.