https://github.com/edgar-code-repository/code-coverage-with-jacoco
Measuring code coverage with the Java Code Coverage Library (JaCoCo)
https://github.com/edgar-code-repository/code-coverage-with-jacoco
Last synced: 12 months ago
JSON representation
Measuring code coverage with the Java Code Coverage Library (JaCoCo)
- Host: GitHub
- URL: https://github.com/edgar-code-repository/code-coverage-with-jacoco
- Owner: edgar-code-repository
- Created: 2023-02-19T03:18:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T23:11:31.000Z (over 3 years ago)
- Last Synced: 2025-03-16T17:45:29.874Z (over 1 year ago)
- Language: Java
- Size: 395 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CODE COVERAGE WITH JACOCO
--------------------------------------------------------------------------
Measuring code coverage with the Java Code Coverage Library (JaCoCo).
--------------------------------------------------------------------------
**JaCoCo plugin added to pom.xml file:**
```
org.jacoco
jacoco-maven-plugin
0.8.5
com/example/demo/CodeCoverageWith*
com/example/demo/configuration/*
com/example/demo/dto/*
com/example/demo/dto/response/*
com/example/demo/model/*
com/example/demo/repository/*
prepare-agent
report
test
report
target/jacoco-report
```
**Some packages were exluded from JaCoCo:**
```
com/example/demo/CodeCoverageWith*
com/example/demo/configuration/*
com/example/demo/dto/*
com/example/demo/dto/response/*
com/example/demo/model/*
com/example/demo/repository/*
```
**Location where the report will be generated:**
```
target/jacoco-report
```
--------------------------------------------------------------------------
**After JaCoco plugin is added, the test maven phase is executed:**

**A report is generated in the directory target/jacoco-report:**

**Right now, there are no tests available and the JaCoCo report says there is a code coverage of 7%
for missed instructions and 0% for missed branches:**

**A few unit tests were added and now the code coverage has reached 97% for missed instructions
and 83% for missed branches:**

--------------------------------------------------------------------------