Refactoring and Test Fakes: Crafting Resilient Code with Confidence
summary
Argues refactor by creating seams (constructor injection, function params, narrower interfaces) so dependencies become replaceable without behavior changes; warns that runtime-generated mocks introduce API sensitivity and hidden mutability; recommends fast unit tests with simple stubs and in-memory test fakes that verify outcomes, not interactions; highlights Kotlin features (immutable collections, final classes) and unidirectional data flow to avoid shared mutable state and make refactoring and tests reproducible.
AI-written summary · about
chapters (4)
- 0:00Introduction and legacy code challenges
- 10:59Kotlin’s role in resilient code
- 17:14Refactoring with test fakes
- 27:08Choosing test doubles wisely
related talks
29mTesting in Practice: Keeping Your Tests Concise and Declarative
37mBeyond the Mockery: Why We Should Embrace Testing Without Mocking Frameworks
27mDe-mock your tests
19mHow to write a mock-free app
31mBeyond the Mockery- Why We Should Embrace Testing Without Mocking Frameworks
41mMocks vs Fakes vs Stubs
25mFakes over Mocks: Shift your paradigm and identify monolithic code
40mTesting Legacy Code: Safe Refactoring
