Testing Without Mocks
summary
Argues that replacing mocks with Nullables — production classes with an encapsulated off switch and a createNull factory — lets tests run the exact same code as production while stubbing only third‑party calls. Shows a homepage controller tested with a nulled Route13 client and nulled HTTP client, demos passing tests that run ~50 ms, keeps just three or four smoke tests, and claims faster, deterministic, refactor‑friendly suites at the cost of adding a createNull factory to IO classes.
AI-written summary · about
chapters (6)
- 0:00Testing without mocks
- 2:33Problems with traditional tests
- 9:22Nullables pattern
- 16:29Live coding demo
- 36:13Refactoring tests
- 45:43Conclusion
related talks
31mBeyond the Mockery- Why We Should Embrace Testing Without Mocking Frameworks
25mFakes over Mocks: Shift your paradigm and identify monolithic code
29m"Testing. Why so serious?"
27mReal World Mocking in Swift
41mMocks vs Fakes vs Stubs
45mStop Using Mocks (for a while)
37mBeyond the Mockery: Why We Should Embrace Testing Without Mocking Frameworks
36mTo Mock or Not to Mock
