What problem does it solve?
This Skill eliminates the confusion and inconsistency of writing Android/Kotlin tests by providing clear, standardized guidance for selecting the right testing tools and patterns for every layer of the test pyramid, reducing flaky tests and wasted debugging time.
Core Features & Use Cases
- Full Test Pyramid Support: Covers JUnit unit tests, MockK mocking, Turbine for Flow/StateFlow assertions, kotlinx-coroutines-test for coroutine testing, Robolectric JVM tests, Compose UI testing, and Espresso instrumented UI tests.
- Best Practice Guardrails: Includes guidance to avoid common anti-patterns like Thread.sleep, over-mocking, and misplacing tests in the wrong source set, plus a review checklist to ensure test quality.
- Use Case: A developer building an Android app with ViewModels and Compose UI can use this Skill to write fast, reliable unit tests for business logic, Compose UI tests with stable semantic selectors, and a thin layer of instrumented end-to-end tests, all following industry best practices.
Quick Start
Use the android-testing skill to write a unit test for your Android ViewModel that verifies it emits a loading state followed by a loaded state when fetching data, using Turbine for Flow assertions and a MainDispatcherRule for coroutine testing.