sábado, 9 de junio de 2012

Code Coverage with Sonar and Maven

Code coverage is a measure. This measure indicate us about the code that has been tested.
Having 100% to code coverage, we can avoid risk while we change the code.
What I need to analyze? When I refer to analyze, I want to say that you need to do unit test and test all the scenarios that exist. While you have high code coverage that's mean that you have more scenarios covered.
Nowadays, we can use Sonar Analyzer Tool, it is a free tool.
If you want to analyze your code and you use maven for your java projects. You only need to add this dependency:


Finally, at root path you can use shell command.


No hay comentarios:

Publicar un comentario en la entrada