Summary
In this chapter, we looked at the ways we can test our Android applications. We also looked at the tools that can help with this and the different types of tests we can deploy.
We started with unit tests and how we can use JUnit, Mockito, and MockK to test small blocks of code in isolation. We then moved on to integration tests with Robolectric and Compose, and then we looked at UI tests for Compose. Finally, we looked at TDD and how it can help us prevent potential bugs by prioritizing the tests.
In the Activity 9.01 – Developing with TDD subsection, we combined the concepts and developed a simple Android application using TDD.
In the next chapter, we will tackle how to perform asynchronous work in an Android application through the use of coroutines and flows. We will also look at how they can be used to load data in the background.
Unlock this book’s exclusive benefits now... |