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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.codehaus.sonar.plugins</groupId> | |
<artifactId>sonar-plugin-cobertura</artifactId> | |
<version>1.5M3</version> | |
</dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn sonar:sonar |
No hay comentarios:
Publicar un comentario