# jacoco

Published articles for jacoco.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Hello8Ball: Exploring Coroutine Testing with a Kotlin Sampler App

DevFeed: [Hello8Ball: Exploring Coroutine Testing with a Kotlin Sampler App](<https://devfeed.tech/articles/hello8ball-32055.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/hello8ball/>)

Published: 2019-11-23T21:36:11Z

Content type: tutorial

Language: en

Sources: [maiatoday](<https://devfeed.tech/sources/maiatoday.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [test](<https://devfeed.tech/topics/test.md>), [CircleCI](<https://devfeed.tech/topics/circleci.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [circleci](<https://devfeed.tech/tags/circleci.md>), [code](<https://devfeed.tech/tags/code.md>), [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [coroutine-testing](<https://devfeed.tech/tags/coroutine-testing.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [detekt](<https://devfeed.tech/tags/detekt.md>), [jacoco](<https://devfeed.tech/tags/jacoco.md>), [kotlinx](<https://devfeed.tech/tags/kotlinx.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

Hello8Ball is a toy sampler app for exploring coroutine testing in Kotlin. It simulates an 8 Ball and includes examples involving network calls, calculations, password generation, synonym lookup, and prime-number checks. The repository includes tests using kotlinx-coroutine-test, CircleCI test execution, detekt, JaCoCo coverage, and a branch converted to JUnit 5.

### Source excerpt

A sampler app to explore Coroutine testing. This is a toy app that simulates an 8 Ball. It can answer questions, find synonmyms, generate a password or check if a number is prime. It was created to make a situation where it makes sense to use coroutines to e.g. go on the network or make a calculation. Then I added tests for all the pieces using kotlinx-coroutine-test. As a bonus the repo is set up to run the tests on CircleCi. It has detekt setup and jacoco code coverage. There is also a branch where all the tests are converted to junit5. Devfest 2019 video This is the companion repo to the KotlinEveryWhereZA 2019 and DevFestZa 2019 talk. Slides are in the repo. code

## Configuring JaCoCo coverage limits in Android Gradle projects

DevFeed: [Configuring JaCoCo coverage limits in Android Gradle projects](<https://devfeed.tech/articles/note-to-future-me-add-jacoco-and-coverage-limits-32071.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/note-to-future-me-add-jacoco-and-coverage-limits/>)

Published: 2018-10-13T13:55:25Z

Content type: tutorial

Language: en

Sources: [maiatoday](<https://devfeed.tech/sources/maiatoday.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [jacoco](<https://devfeed.tech/tags/jacoco.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

A practical Android Gradle snippet that adds JaCoCo test coverage, Kotlin support, and coverage limits for selected important classes or packages. It explains how to add the configuration, run coverage verification, and find the generated HTML report. It also warns that a Robolectric-related configuration line can crash unit tests on Java versions newer than 8.

### Source excerpt

I have found myself adding jacoco and coverage limits to more than one Android project. Enough times for me to extract the gradle bits in to a little nugget of grooviness to just drop into a project as needed. For a while now I have been reading about test coverage numbers and working with my intuition about what is the most valuable thing for me to spend my time on when building something. Also Kotlin. In the light of this my gradle build file snippet contains the following: Jacoco for test coverage Kotlin support A way to choose important classes and only set coverage limits on those Do this, Put the gist in a file jacoco.gradle Modify the jacoco.gradle file to add limits for your important packages. Add this line to your build.gradle apply from: 'jacoco.gradle' And then run the command ./gradlew tasks to see what new tasks are there to run. e.g. in the reporting section find something similar to ./gradlew/testDevDebugUnitTestCoverageVerification which will run the tests, make coverage reports and apply limits. Find the reports in a path similar to this ~/your\_project/your\_module/build/reports/jacoco/testDevDebugUnitTestCoverage/html/index.html Without further ado, the gist: The code in the gist was taken from so many blogposts. I can't even remember them all. Thanks to the original authors. Also note there is a small piece of cargo cult code that kept sneaking in from sundry blogposts that I don't need because I don't have Robolectric tests. As it turns out this code crashes unit tests on Java > 8. So remove this code if you have it and if it fits your usecase. tasks.withType(Test) { jacoco.includeNoLocationClasses = true }

## Measuring production code coverage with JaCoCo

DevFeed: [Measuring production code coverage with JaCoCo](<https://devfeed.tech/articles/measuring-production-code-coverage-with-jacoco-37828.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/production-code-coverage-jacoco/>)

Author: Carlos Alexandro Becker

Published: 2017-03-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>), [Puppet](<https://devfeed.tech/topics/puppet.md>), [Maven](<https://devfeed.tech/topics/maven.md>)

Tags: [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [jacoco](<https://devfeed.tech/tags/jacoco.md>), [java](<https://devfeed.tech/tags/java.md>), [maven](<https://devfeed.tech/tags/maven.md>), [monolith](<https://devfeed.tech/tags/monolith.md>), [production](<https://devfeed.tech/tags/production.md>), [puppet](<https://devfeed.tech/tags/puppet.md>)

### AI overview

This tutorial explains how to use JaCoCo in a Java production environment to generate production code coverage reports. It describes instrumenting a production application server, collecting binary report files, and compiling them into HTML reports to identify code that is not executed.

### Source excerpt

Microservices is the new fancy way of doing applications. Yet, most companies still have big and old monoliths in production. In fast evolving software of this size, it's usual to have lines of code which are never executed in production. Production code coverage reports can help us find those lines.