Testing with JUnit, Mockito, MockK, and Compose
In this chapter, we will explore how we can test an Android application and the variety of tools that are at our disposal for testing. We will begin by going over the types of tests that are available to us. Each Android project has the ability to run two types of tests. The first is local tests, which are placed in the test folder and run on your development machine. The second type is represented by instrumented tests, which are placed in the androidTest folder and run on a device or emulator.
We will go over the types of tests that can be written for an application and which folder they can be placed in. We’ll be starting from unit tests that typically belong in the test folder before moving on to integration tests, which can be placed in either folder, and then to user interface (UI) tests, which typically go in the androidTest folder. We will then move on to the test-driven development (TDD) paradigm, which will help...