Reputation: 3128
I have managed to create a JaCoCo XML coverage report. In the report I get:
<class
name="PATH"
sourcefilename="DeleteUtility.java">
<method name="<init>"
desc="(Lcom/commons/treenode/PathNode;)V"
line="20">
<counter type="INSTRUCTION" missed="17" covered="0" />
<counter type="LINE" missed="6" covered="0" />
<counter type="COMPLEXITY" missed="1" covered="0" />
<counter type="METHOD" missed="1" covered="0" />
</method>
...
I have a few questions about the format:
<init>"
or "<clinit>"
. I guess it's <init>
and <clinit>
. What does those methods mean?desc
mean?COMPLEXITY
mean?INSTRUCTION
the amount of keywords in the method?Upvotes: 2
Views: 2725
Reputation: 1
<init>
is the contructor the a class DeleteUtility
<clinit>
is the code coverage of static variables (e.g. static Logger logger = Logger.getLogger(LoggingExample.class.getName())
. In the HTML report it is stated as static{...}
desc
contains the parameters types and return-type of the method. In your example the only parameter would be PathNode and the return type would be void (V).
There are some special cases for desc
:
L
(e.g. Ljava/lang/String
)[
(e.g. [Ljava/lang/String
)A method like the following:
public int foo(int i, byte[] b, String s, ABC a, long l) {..}
would have the following desc:
desc="(I[BLjava/lang/String;Lorg/foo/ABC;J)I"
Upvotes: 0
Reputation: 4857
Instruction
smallest unit JaCoCo counts are single Java byte code instructions. Instruction coverage provides information about the amount of code that has been executed or missed.
Complexity
calculates cyclomatic complexity for each non-abstract method and summarizes complexity for classes, packages, and groups.
Method
Each non-abstract method contains at least one instruction. A method is considered as executed when at least one instruction has been executed
Line
For all class files that have been compiled with debug information, coverage information for individual lines can be calculated
Branch
The total number of branches (if and switch statements) in a method that can be executed or missed.
see the documentation in Jacoco https://www.eclemma.org/jacoco/trunk/doc/counters.html
Upvotes: 1