EMMA- because you need to check the code coverage

EMMA is a free open-source Java code coverage tool. The keyword here is free, as I am not aware of many free code coverage tool. Moreover, I am not sure if people would like to spend money on a code coverage tool, especially if we are working on small applications. It is relatively easier to check the code coverage in small applications, for example, if you run the application in debug mode on eclipse, you can very well see line by line which code is getting executed. But if your application is a multi thousand line, this approach fails. In that case you would need a proper code coverage tool, and if you are getting one for free, nothing like it.

One question we forgot to ask is, why do I need to check the code coverage at all. Say, we have an application where we need to get user information and this is done using three different forms which are handled by 3 servlets at the back-end. Now someone came up with an idea that instead of three forms we can have 2 or 1. The idea was good and it was implemented, design got changed, test suite got changed, code got changed as per the new design. But there is a major possibility that some code which was part of earlier design did not get remove. It was old code, so nobody bothered as it it will not be used any more. At then, we end up shipping code which was not required. More changes to the application and more such code. So it is better to check what all is required or not.

Another thing might be, that the code shown by the tool as unused is actually useful code, but that did not get executed while running the test suite. That implies, your test suite is not complete enough.

Now if you are convinced, here is your quick start link – Quick Start with EMMA