Take a Stab at Test Friendly Architecture
summary
Argument: follow SRP, pick a UI pattern like MVVM, prefer interfaces and explicit constructor dependencies so unit tests use plain constructors and Mockito rather than DI. Tooling: use Dagger2 to inject real or fake implementations for integration tests—author builds a reminder app with a fake reminder store (in-memory) and a test component plus custom test runner; integration tests run with gradlew connectedAndroidTest. Outcome: DI reduces boilerplate, gives compile-time graph checks, and the approach proves practical though Canary Android Studio requires running tests from the command line.
AI-written summary · about
chapters (26)
- 0:00Intro
- 0:24Goals
- 1:51Sample Application
- 2:15List Screen Dependencies
- 3:12Create Screen Dependencies
- 5:25UI Architecture Selection
- 6:12Sample Architecture
- 7:46Bias Towards Interfaces
- 8:24Example Refactor
- 10:22Implicit Dependencies
- 14:44Dagger Recap
- 16:44Apply SRP to Dependency Injection
- 18:54Injecting Interfaces
- 19:41Different Interface Injection
- 20:31Perfect Tool For The Job
- 24:07Remember This?
- 24:20No Need For DI
- 25:34Fakes?
- 26:17Module For Fake
- 26:28Test Component
- 27:12Supply Test Application
- 27:22Using Custom Test Runner
- 27:40Example Integration Test
- 28:31Unused Test Runner
- 29:44Custom Robolectric Application
- 30:47Who is this guy? Brian Gardner @bgardner7








