Wednesday
10
Jun 2009

Code Coverage in Eclipse with EclEmma

(8:38 am) Tags: [Software, Projects]

I am fortunate enough to be working on a project where I get to start from a clean slate. I set up test cases using JUnit, and Eclipse runs them within the IDE easily. Next I wanted to know how well the unit tests were covering the code.

Enter EclEmma, an Eclipse plugin for showing code coverage. Simply add the update site of http://update.eclemma.org/ to your sites, and install/restart Eclipse. Next, run your test case with the EclEmma run button, and you get a report of code coverage. It even highlights the code in the Java editor to show no/partial/full coverage of a line.

This is the way an Eclipse plugin should operate. Great work, EclEmma team! Now, if it only tested a webapp… I know I can do it manually, but this simple ‘click here’ experience leaves me not wanting to do that.

Popularity: 54%

Comments: Comments Off