Cobertura is a free Java tool that calculates the percentage of code accessed by tests.
It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.
- Can be executed from ant or from the command line.
- Instruments Java bytecode after it has been compiled.
- Can generate reports in HTML or XML.
- Shows the percentage of lines and branches covered for each class, each package, and for the overall project.
- Shows the McCabe cyclomatic code complexity of each class, and the average cyclomatic code complexity for each package, and for the overall product.
- Can sort HTML results by class name, percent of lines covered, percent of branches covered, etc. And can sort in ascending or decending order.
The Cobertura plugin calls the Cobertura tool’s “cobertura-instrument”, “cobertura-check” and “cobertura-report” from the command line and passes the user-provided parameters in the parameter panel.
This plugin allows you to use Cobertura to measure the code coverage of your java projects and also creates reports about the code coverage statistics.
Moreover, you can easily detect errors with our postp feature.