The Importance of Being Tested
summary
Argues that tests must target behavior not call order, and that dependencies must be injected rather than built inside classes so coroutines, dispatchers and network engines are replaceable. Shows a fragment that updates from a repository on resume and a Compose counter UI that is verified with composeTestRule. Recommends Retrofit + MockWebServer or Ktor mock engine for network, Robolectric for local Android, Espresso for full UI, notes green builds take ~7–8 min and incremental builds 1–2 min.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:09Why testing matters
- 3:00Avoid building dependencies
- 6:17Test logic not code
- 11:40Types of tests
- 13:56Integration testing explained
- 18:13Speed up Android tests
- 21:04Fragment integration test
- 24:36Network testing strategies
- 27:54Retrofit mock server
- 30:23Ktor mock engine
- 32:13UI testing with Espresso
- 35:25Jetpack Compose testing
- 38:40How to start testing
related talks
42mRock-Solid UI and Instrumentation Testing
38mTesting Out Kotlin
38mCompose UI Testing beyond layouts
29mTesting in Practice: Keeping Your Tests Concise and Declarative
36mTesting: how hard can it be?
46mTesting Compose Anew: Simplicity, Reliability, Flexibility
35mTake a Stab at Test Friendly Architecture
42mBuild testable apps for Android
