Last Updated: October 20, 2022

How to Install and Use EclEmma

In this tutorial, we will show you how Install and Use EclEmma.

EclEmma is a free Java code coverage tool. It brings code coverage analysis directly into the Eclipse workbench: Fast develop/test cycle: Launches from within the workbench like JUnit test runs can directly be analyzed for code coverage.



1.Install EclEmma.
  1. Go to Help.

  2. Select Eclipse MarketPlace.

  3. Then Search for EclEmma on the MarketPlace.

  4. Select EclEmma Java Code Coverage.

  5. Click Install.

  6. Click on accept.

  7. Click Finish.

Figure 1. Install EclEmma
Figure 2. Install EclEmma

It will ask you to restart the IDE, Click Restart Now.

Figure 3. Restart the IDE.
2.Open the JUnit Project.

Open Created JUnit Project.

Figure 4. JUnit Project
3.Coverage As JUnit Test.

Run Project as Coverage :

  1. Right-click on the Project.

  2. Select Coverage As.

  3. Select JUnit Test.

After running the Coverage tool tab will appers as shown in the figure below.

Figure 5. Coverage tool

Extend the files as the figure below, it will show the percentage.

green as covered and red not, you can see the method which did not covered in the coverage test.
Figure 6. Coverage tool

Let’s see the method which did not get covered its "testAddWrongNumbers" method, as shown below figure, The green code shows that method covered, the red did not get covered.

you have total coverage 73.5% ,and for the 66.7%, 0.0% for "testAddWrongNumbers" method, and 100% for .

That is How to Install and Use EclEmma, Enjoy.

The End