adle.Ĭlasspath "org.jacoco::0.8.6"Īnd under allprojects apply the plugin for multimodule projects. Step 1Īdd jacoco dependency in project gradle file i.e. JaCoCo - Code Coverage for java base project and android multi module project testing android kotlin testdrivendevelopment Kazi Md. Now let's start setting it up for a multimodule android application in kotlin.
The focus is on providing a lightweight, flexible and well-documented library for integration with various build and development tools.Įnough of theory. JaCoCo should provide the standard technology for code coverage analysis in Java VM based environments. To go by the books here is what Jacoco is: For this, we will use the well-known library for code coverage JaCoCo. Maybe we will talk about Unit Tests implementation using Mockk or Mockito some other day but today we will discuss checking the coverage of the test cases you have written. But, how do we check the authenticity of the code? In comes to rescue Unit Tests cases. We want to check if the code written is bug-free or not. If you have not tried, do give a try to it as it is one of the most basic requirement when you are working on a project. In our last post, we discussed how to set up ktlint within our android project. If you haven’t already, create a free account at Pusher.Setup JaCoCo code coverage with your Multimodule Android App Kotlin Now let’s start by creating a Pusher application. Android development (an upper-beginner level at least).I also assume that you are familiar with: Optionally, a Java IDE with Kotlin support like IntelliJ IDEA Community Edition.Two Android emulators or two devices to test the app (because there’s no fun in chatting alone).The latest version of Android Studio (at the time of this writing 3.1.2).Here’s what you need to have installed/configured to follow this tutorial: You’ll use Spring Boot and Kotlin to build the endpoint of the API.įor reference, here is a GitHub repository with all the code shown in this tutorial and instructions to run it. Then, when the user enters a message, the application sends it to an endpoint of server-side API, which publishes the information of the message to a Pusher channel so all the connected clients can receive it. In the first screen, the user enters a username.