Mocks, Fakes, Stubs – Is There a Difference? Do You Still Need Them?
summary
The talk explains different kinds of test doubles (mocks, fakes, stubs, etc.), how they differ, and how each impacts test speed, stability, and maintenance. It shows practical Java live-coding examples of using these doubles in unit and integration tests, and concludes with a brief look at a new "Nullable" concept as an evolution of existing patterns.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:12Why this talk?
- 2:36Test basics
- 4:44X-Unit patterns
- 7:55Integration tests live
- 11:07Calc engine live
- 13:13Calculator with dependency live
- 15:43Mocks vs Stubs live
- 19:37Mocks with verifications live
- 23:11Fakes and lightweight impls live
- 26:46Refactoring live
- 30:24Future of test patterns
- 33:34In-memory DBs and Testcontainers
- 36:03Mocking external code
- 37:48Testing without mocks
- 40:39Modern mocking use cases
- 41:43Conclusion
- 42:06Q&A
related talks
36mMocks, Stubs, and Spies, Oh My!
30mMocks, Stubs, and Spies, Oh My
41mMocks vs Fakes vs Stubs
37mBeyond the Mockery: Why We Should Embrace Testing Without Mocking Frameworks
31mBeyond the Mockery- Why We Should Embrace Testing Without Mocking Frameworks
47m"Testing with Doubles: Why, When, and How?"
27mDe-mock your tests
40mTest Doubles are Not To Be Mocked
