What makes good unit tests for Android apps
summary
Explains how to make Android unit tests fast, reliable and maintainable by splitting logic into pure JVM tests, using Robolectric for framework-dependent code when appropriate and instrumentation tests only when necessary. Compares Mockito-style stubs, spies and fakes (noting they can speed tests but increase upkeep), measures runtimes (Robolectric ~1s startup; instrumentation slower), and recommends patterns like humble objects and test data builders to avoid flakiness and hidden failures (example: a stubbed repository masking an ItemNotFoundException change).
AI-written summary · about
chapters (12)
- 0:00Introduction
- 5:176 traits of good unit tests
- 7:49Android test environment
- 12:54Test doubles trade-offs
- 21:44When to use test doubles
- 27:45Test design for reproducibility
- 31:15Fast feedback techniques
- 34:02Humble objects summary
- 36:50Regression detection reliability
- 38:15Minimizing false positives
- 39:19Maintainable readable tests
- 43:33Summary








