Testing

We have developed an application with a significant code base. We tried it and we think that our application has no bugs. However, we can be wrong! Sometimes, even if we are sure that there are no bugs in our application, it can happen that a dangerous issue is waiting. How to prevent this? Simple! We will write tests that will check our code for us. In this chapter, we will introduce you to testing and give examples on how to set up, write, and run your tests.

In this chapter, we will cover the following topics:

  • How to write your first test
  • Using test suites
  • How to test UI
  • Running tests
  • Unit and instrumentation tests

Get Mastering Android Development with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.