Viewing the Code Coverage
“What’s a good coverage number?” is a question that can start a bar fight among drunken developers: “If we write a test and then write the minimum code necessary to make the test pass…” Irrespective of what your team believes to be the appropriate coverage percentage, you’ll need a way to view the coverage. Jacoco, which is a coverage tool that works for Java, works nicely with Kotlin as well. Let’s see how we did with code coverage so far in the sample we created in this chapter.
Whether you’ve been using Gradle or Maven to build the examples so far, you’ve been generating the code coverage all along. If you’re using Gradle, take a look at the configuration for Jacoco in the build.gradle.kts file and take note of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access