Testing: how hard can it be?
summary
Builds a Compose login flow and proves it with JVM tests that exercise ViewModel coroutines, a Retrofit/Moshi API client, and an EncryptedSharedPreferences-backed token store; uses an in‑memory settings implementation and a real API data source fed by JSON fixtures for API responses so parsing is verified, and resorts to Robolectric for Android APIs only to test the Wear callback client. Tests cover initial UI state, the two‑step authenticate+token exchange, and survive an architecture rewrite, so the flow actually works and stays stable.
AI-written summary · about
chapters (8)
- 0:00Introduction and testing journey
- 5:03Testing pyramid theory vs reality
- 10:00Starting the login feature project
- 16:18Refactoring operations and settings
- 22:57Testing external dependencies and APIs
- 28:14Unit testing myths and behavior focus
- 32:56Optimizing test pyramid and stability
- 34:44Summary and Q&A
related talks
46mEfficient Android UI Testing
40mThe Importance of Being Tested
23mComposing With Confidence
38mCompose UI Testing beyond layouts
42mRock-Solid UI and Instrumentation Testing
36mTesting Jetpack Compose UI
35mThe real face of functional testing
46mTesting Compose Anew: Simplicity, Reliability, Flexibility
