Fake it till you make it - effective use of test doubles
summary
Describes concrete unit testing patterns for Android: use stubs, fakes, mocks and dummies to isolate a splash presenter with dependencies (router, view, use case, tracking id), show a fake view that records loading/error state, and use Mockito to stub data providers and verify method calls. Recommends writing simple custom fakes instead of heavy mocking, stresses constructor injection and interfaces, notes Mockito can't mock suspend functions and MockK supports coroutines and static mocking.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:13Test pyramid and unit tests
- 3:02Test doubles in Android
- 8:43Types of test doubles
- 13:26Mocks vs custom fakes
- 19:56Mockito vs MockK
- 22:11Testing static properties
- 27:59Key takeaways and summary
- 30:35Q&A session
related talks
36mMocks, Stubs, and Spies, Oh My!
42mMocks, Fakes, Stubs – Is There a Difference? Do You Still Need Them?
30mMocks, Stubs, and Spies, Oh My
27mFake Your Test Away: How To Abuse Your Test Doubles
39mPlease Don't Mock Me
25mFakes over Mocks: Shift your paradigm and identify monolithic code
47m"Testing with Doubles: Why, When, and How?"
41mMocks vs Fakes vs Stubs
