O'Reilly logo

Apache Maven 3 Cookbook by Srirangan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Generating code coverage reports

In the Generating unit test report recipe, we leveraged the Surefire plugin to generate reports of our unit tests. These reports contained information about the success or failure of each individual test. However, what it lacked was an assessment of the scope of the unit tests itself in relation to the source code base.

Are these unit tests sufficient? Do they provide test coverage to all important portions of the functional code?

Cobertura is a tool that helps you answer some of these questions. It analyzes your source code and test code, calculates the percentage of code accessed by the tests and thus identifies portions of the code that aren’t covered by tests.

Cobertura instruments Java bytecode after compilation, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required