Test Driven Design - Coupling Loosely
summary
Claims that mock objects let tests exercise legacy code without changing it but do not reduce coupling or improve cohesion; shows a concrete download test that mocks network and file calls. Demonstrates replacing big switch statements with strategy pattern, using chainable set-based functions (jQuery style) to eliminate error branches, and applying currying and closures in C# and Python to decouple UI from authentication logic and add caching. Recommends query-over-objects, SQLAlchemy/Linq POCO patterns, and business-level unit-of-work transactions to remove database mocks and keep tests fast.
AI-written summary · about
chapters (16)
- 0:00Start
- 1:08Framing Discussion
- 4:18Problem with Loose Coupling
- 6:09Mock Objects
- 6:49Mocks
- 7:33Code Level Object Level Mocks
- 8:29Mock Object Testing
- 10:04Algorithms
- 12:54Chainable Set Based Functions
- 17:19Functions
- 21:46Closures
- 25:17Algorithmic Decoupling
- 26:33Data Access
- 29:59Database Transactions
- 32:08Restful Requests
- 36:02Request Lifecycle
related talks
01h 00mTest-Driven Design Insights - 10 Hints You Were Missing
33mHow to Practice Test Driven Development without Shooting Yourself in the Foot
39mIntro to Mocking: Why Unit Testing Doesn't Have To Be So Hard
01h 05mMicrotesting
36mTo Mock or Not to Mock
31mBeyond the Mockery- Why We Should Embrace Testing Without Mocking Frameworks
52mBuilding Operable Software with TDD (but not the way you think)
39mTDD Revisited
