Are there any such code coverage tools in Java that give the different paths in the program. Basically the idea is to ensure that all loops and nested loops are covered during execution. That is to be able to ascertain if all the loops in a code base have been executed at least through one iteration.
JaCoCo. JaCoCo is an open-source toolkit for measuring and reporting Java code coverage. JaCoCo is distributed under the terms of the Eclipse Public License. It was developed as a replacement for EMMA, under the umbrella of the EclEmma plug-in for Eclipse.
Cobertura is a code coverage tool. This is actually a code coverage utility tool developed specifically for Java. 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.
In simple terms, code coverage analyses each line in the code and confirms if it will be executed by a test case. There are several tools that do this and in this post, we will explore code coverage tools for Java. Cobertura is also available as Maven, Eclipse, Jenkins and IntelliJ Plugin.
EMMA is an open-source toolkit for measuring and reporting Java code coverage. EMMA distinguishes itself from other tools by going after a unique feature combination: support for large-scale enterprise software development while keeping individual developer's work fast and iterative at the same time.
Cobertura, EMMA and even Clover only do branch/decision coverage (in addition to line/statement coverage, of course). Clover also provides method coverage (which simply measures if a method was entered at all during execution).
For path coverage (plus line/statement coverage), try JMockit Coverage.
A sample report can be found here.
Actually, as of now this is only an initial version of the new path coverage support, which I still need to improve.
Cobertura is another popularly used tool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With