Put Your Tests on a Diet:Testing the Behavior and Not the Implementation
summary
Argues that replacing heavy mocking with a Given‑When‑Then BDD style on a sample chat app (StateFlow viewmodel, use cases, repository, message factory) yields a single, fast test suite that mocks only the external chat data source and avoids brittle verifies that fail because the factory generates random IDs/dates. Uses the cest behavior spec to run the flow-based tests, achieves full coverage of production classes with fewer tests, lets refactoring pass without breaking tests and recommends mock only external services.
AI-written summary · about
chapters (14)
- 0:00Introduction and speaker intro
- 3:15Modern app architecture overview
- 4:39Sample chat app walkthrough
- 7:05Problems with mocking every layer
- 13:23Anti-pattern test code review
- 15:51Expert opinions on mocking
- 17:18Behavior-driven development explained
- 19:01BDD test structure demo
- 22:12Testing the whole feature flow
- 24:38Redefining unit tests
- 25:42When to mock in BDD
- 26:46Benefits of behavior testing
- 28:54TDD and refactoring confidence
- 31:25Key takeaways summary








