Module 09 of 10

Testing & Debugging

Lessons

About This Module

Every app has bugs. Testing catches them before your users do, and debugging helps you find the cause when something goes wrong. Together they are what let you change your code with confidence.

Begin with unit tests: small, fast tests for logic such as a ViewModel, using JUnit, MockK, and Turbine for coroutines and Flow. Then see how UI and instrumentation tests check the screen itself. For debugging, learn Logcat, breakpoints, and how to step through code and inspect variables in Android Studio.

The lessons below are video tutorials. Start with the testing overview, then work through the ViewModel tests, and finish with the debugging videos. Once you are comfortable, continue on to Publishing & Play Store.

Lessons

5 videos
01

Android Unit Testing with JUnit 5, MockK & Kotest

Write unit tests, UI tests, and instrumentation tests for an Android app using Kotlin. A good first stop.

02

Unit Testing ViewModel: MockK, Turbine, Coroutines

Make unit tests for a ViewModel using MockK, Turbine, coroutines, and runTest.

03

Easy ViewModel UI State Testing with Coroutine Test and Turbine

Test a ViewModel’s UI state with kotlinx-coroutines-test and the Turbine library.

04

Debugging Kotlin in Android Studio

Debug a Kotlin Android app: set breakpoints, inspect variable values, and step through your code.

05

Android Studio: Debugging Tips n’ Tricks (Android Dev Summit ’19)

An Android Developers session on powerful debugging features in Android Studio.