I only just discovered the EclEmma plugin for Eclipse. It's effortless. The first thing you're going to want to know when you start using it is probably "I hate using the mouse. What are the keyboard shortcuts for this thing?" Well, they thought of that and documented it nicely for you: keyboard shortcuts.

I guess it's not for nothing that it was an Eclipse Community Awards finalist.

Edit: almost a year on and I still love this tool.
Hi Merlin,

great, I was looking for something like this for a long time as an alternative to Clover etc... I'm going to try this thingy soon ;-)

Greetings from Berlin,


I just recently ranted about how much I don't care about code coverage and here you go advertising a code coverage plugin for Eclipse! While I personally feel like code coverage is one of those pointless metrics like the controversial lines of code metric I also happen to find it a very important measurement. What I mean is this. It's irrelevant if you're practicing T.D.D. the right way but at the same time I found out (recently) that it can be used to double check that you're practicing T.D.D. the right way. You see I had this T.D.D. training last week (that I thought I blogged about but I don't remember hitting the publish key) and the guys were all like, "run clover to find the areas where you cheated with T.D.D. Then they mentioned a trick where you can remove a test and run clover again to catch redundancy. It was a real slick trick. If your coverage is at 89% for eg. (or 173% if your me) when you first run it then you comment out a test and the coverage doesn't change then you got some redundancy between your tests that needs refactoring. I learned that as well as a bunch of other cool tricks like how to force developers to get over their fear of the merge tool. We'lll rap about it sometime...

Yes please Cliff. Any tips and tricks much appreciated.

A nice article. Lot of information. I have a small problem, though. I plugged in EclEmma to Eclipse and it works fine for stand alone applications. How does it work for web applications?

Good question! To give you the wrong answer:

You would need to launch a light-weight webserver like Jetty as part of your test setup.

The right answer:

Code coverage is for unit tests! You're not unit testing if you need to start a webserver.

Hope that helps, Alok.