Questions tagged [jacoco]

JaCoCo a coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

JaCoCo is an EPL-licensed, open-source code coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

Compared to Cobertura, it has lower runtime overhead but less precision. It is unable to record hit counts, it only records red/green, however it can show coverage on class, method, line, complexity, branch and instruction level. It also has the ability to merge the results of multiple analyses when generating a report.

QuickLinks:

Related Tags:

JaCoCo is the successor of the EclEmma Eclipse plugin for the Emma coverage tool. If a search through -tagged questions doesn't help, try searching for the tag.

The tag is used for general topics related to code coverage measurement.

1891 questions
0
votes
0 answers

maven project not able to generate jacoco xml reports

I have a maven project which is using in jacoco plugin for generating in test coverage reports. The plugin is configured as : org.jacoco jacoco-maven-plugin
Scientist
  • 1,458
  • 2
  • 15
  • 31
0
votes
0 answers

JaCoCo fails with "initializationError FAILED"

PS D:\Projects\MyApp> ./gradlew jacocoCoverage Configuration on demand is an incubating feature. Task :myLibModule:testDebugUnitTest com.example.sheets.BottomSheetServiceTest > initializationError FAILED java.lang.IllegalArgumentException at…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
0
votes
1 answer

jacoco showing filtered code in the coverage report

I have added a filter via annotation to exclude a method from jacoco coverage as mentioned here. But when I see the jacoco html report for coverage I see the filtered method being shown in red as not covered. Please check the attached screenshot. Is…
tuk
  • 5,941
  • 14
  • 79
  • 162
0
votes
0 answers

Finding dead code in production environment using code coverage tool

I'm working on a huge monolith Java application with over 15000 lines of code that has been developed for quite a while now. My task is to find dead code (code that is never used) in the application. My idea was to approach this with JaCoCo code…
ripsta
  • 1
  • 2
0
votes
2 answers

Where to set the coverage runner in Android Studio Chipmunk?

In Android Studio 4.1.2, it can set the coverage runner for JaCoCo at but in Android Studio Chipmunk (2021.2.1), there is no place to choose JaCoCo as the coverage runner How to run the JaCoCo coverage test in Chipmunk? Update: As @Daya Nithi…
lannyf
  • 9,865
  • 12
  • 70
  • 152
0
votes
1 answer

Code coverage for compare method not 100%

I have written custom comparator and test method to test it. But Whatever I do, I don't get 100% code coverage. It is not a big issue as I can live without 100% code coverage, but curious to know where I went wrong. I tried suggestion from some…
Sammy Pawar
  • 1,201
  • 3
  • 19
  • 38
0
votes
1 answer

Jacoco's report not generate

In my pom.xml coverage org.apache.maven.plugins
Alexei
  • 14,350
  • 37
  • 121
  • 240
0
votes
1 answer

Not generate jacoco-ut.exec coverage report

Java 1.8. Maven 3.8. I want to generate coverage report of junit tests. So I use this in my pom.xml org.jacoco
Alexei
  • 14,350
  • 37
  • 121
  • 240
0
votes
0 answers

Jacoco maven plugin only generates correct report after calling mvn verify twice with jetty maven plugin

I am trying to generate a jacoco report for my multi module project. However I need to run mvn verify twice in order to get the correct coverage. After the first mvn verify I get a report, but with 0% coverage. Here is my parent pom file:
0
votes
1 answer

How can I exclude specified methods and some code of lines in a method from jacoco code coverage?

Require - exclude some methods and exclude some code of lines in a method
0
votes
1 answer

how to link Spring boot Rest API unit test, integration test, owasp dependency check coverage to sonarqube

I have a new springboot rest api and i want unit test coverage of the api, integration test to reflect in sonarqube. I created a project from spring initalizer. How to proceed further
Guru Cse
  • 2,805
  • 2
  • 18
  • 15
0
votes
1 answer

Github workflow problem with no details on error

I'm new to Github workflows. I wanted to do a POC/demo showing code coverage and gating. I'm trying to fix two issues: Get past the code coverage issue (the previous run worked) Make a low coverage un-mergable into the master branch. I don't know…
Woodsman
  • 901
  • 21
  • 61
0
votes
1 answer

Maven Surefire not detecting Junit5

I have a very simple Maven project that I updated here, I obtained it simplifying my real project: GitHub repository I need to run Surefire plugin to compile tests, so they can be used by Jacoco. I tried sooo many things, even changing/reducing the…
Pipkin
  • 99
  • 1
  • 2
  • 7
0
votes
0 answers

Multi module Scala project gives 0% sonar code coverage

I am using SonarQube Enterprise EditionVersion 7.9.1. I am running maven goal for my multi-module scala project as : mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify…
Priya
  • 173
  • 6
  • 18
0
votes
1 answer

Why does Jacoco not include an XQuery runner class in code coverage, even with multiple unit tests?

I have the following class using Saxon S9 API, whose only purpose is to run an XQuery (.xq) file. public class SaxonXQuery { public void executeXQuery(String xQueryFilename) throws IOException, SaxonApiException { try { Processor saxon =…