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.
Write unit tests, UI tests, and instrumentation tests for an Android app using Kotlin. A good first stop.
Make unit tests for a ViewModel using MockK, Turbine, coroutines, and runTest.
Test a ViewModel’s UI state with kotlinx-coroutines-test and the Turbine library.
Debug a Kotlin Android app: set breakpoints, inspect variable values, and step through your code.
An Android Developers session on powerful debugging features in Android Studio.