9 ms·
I don't do TDD - so this is my outsider's understanding The issue is that if you need to mock then your design is not really properly decoupled. The mock bakes
by geokon 3y ago
I don't do TDD - so this is my outsider's understanding
The issue is that if you need to mock then your design is not really properly decoupled. The mock bakes in assumptions about your program state - which may or may not hold up in the real world. This ends up creating a sort of invisible coupling to whatever will be creating/updating the state in the real world
The terminology is a bit fuzzy b/c the author describes his unit tests as using mocks - but to me that's not a unit test - that's an integration test..
At the end of the day you do need some coupling and some integration tests are inevitable - but the idea is that TDD pushes you to minimize that
Would love to hear anyone's corrections :)