Unit Test Your Code, Even Your UI!
summary
Shows how Android Gradle plugin features let unit tests run on the JVM so UI logic can be tested quickly without a device, using Robolectric shadows or small custom adapters in place of Android stubs. Demonstrates an MVP-like split (data provider / presenter / view proxy) to make views mockable, and walks through a tic-tac-toe example with tests for moves, remaining turns and AI; reports prior coverage as low (0.01%) and JVM test run times around 2 seconds.
AI-written summary · about
chapters (18)
- 0:00Unit test importance
- 2:00Unit vs instrumentation tests
- 5:29Android unit test setup
- 6:52TDD basics example
- 7:54TDD class testing
- 10:38Android test dependencies
- 12:27Mocking TextUtils issues
- 15:59Tic-tac-toe TDD testing
- 20:59Android activity testing
- 24:11MVP for UI tests
- 26:18Tic-tac-toe MVP implementation
- 30:13Mocking UI components
- 32:43Optimizing Android view tests
- 33:46Code coverage importance
- 35:55Code coverage in Android Studio
- 36:16Singleton testing issues
- 37:41Mocking singleton alternatives
- 38:37Summary and resources








