Improve Lombok @Data Code Coverage

In 0.8.0 release, Jacoco added support for filtering out all methods annotated with @lombok.Generated from their reports. The only thing you need to change is to add lombok.config to the root of your project with the following settings: config.stopBubbling = true lombok.addLombokGeneratedAnnotation = true config.stopBubbling = true tells Lombok that this is your root directory … Read more

A difference between statement and decision coverage

The answer by Paul isn’t quite right, at least I think so (according to ISTQB’s definitions). There’s quite significant difference between statement, decision/branch and condition coverage. I’ll use the sample from the other answer but modified a bit, so I can show all three test coverage examples. Tests written here gives 100% test coverage for … Read more

IntelliJ: (Coverage): Error during class instrumentation: … java.lang.ArrayIndexOutOfBoundsException

This seems to be the bug that is reported is IDEA-269838. It is currently marked as resolved / fixed without specifying the version in which it is fixed. I think that means that the fix will be in Intellij IDEA 2021.3 which is due this month (November 2021) according to the JetBrains website.

What is the branch in the destructor reported by gcov?

In a typical implementation the destructor usually has two branches: one for non-dynamic object destruction, another for dynamic object destruction. The selection of a specific branch is performed through a hidden boolean parameter passed to the destructor by the caller. It is usually passed through a register as either 0 or 1. I would guess … Read more

Jest coverage: How can I get a total percentage of coverage?

Thanks to Teneff’s answer, I go with the coverageReporter=”json-summary”. jest –coverage –coverageReporters=”json-summary” This generates a coverage-summary.json file which can easily be parsed. I get the total values directly from the json: “total”: { “lines”: { “total”: 21777, “covered”: 65, “skipped”: 0, “pct”: 0.3 }, “statements”: { “total”: 24163, “covered”: 72, “skipped”: 0, “pct”: 0.3 }, … Read more