📚 Encyclopedia

Android · updated 2026-11-02

Android unit and instrumentation testing gotchas

androidtestingjunitmockkrobolectriccoroutinescomposehiltgradle

Collected traps from a Kotlin/Compose app with more than 1,300 JVM unit tests (JUnit 4, MockK, Robolectric, kotlinx-coroutines-test) and a few instrumentation tests. Many of them make tests pass while testing nothing, which is worse than failing.

Coroutines

MockK

Robolectric

Hilt

Compose and Kotlin compile traps

Build and tooling

See also

Linked from

Sources: message memory (project_testing, project_premium_wave, startup_perf_2026_09), keyboard memory (history), tldr post #1874