3 ms·
Mocks don't test the joints, which you have just suggested are where the bugs are. Fakes get you a lot further without needing more comprehensive integration t
by barrkel 5y ago
Mocks don't test the joints, which you have just suggested are where the bugs are.
Fakes get you a lot further without needing more comprehensive integration testing.
Fakes simulate dependencies - so you can test the joints - but can be tested themselves, and most importantly can have conformance tests that validate that the fake acts like what it is faking.
- smaudet 5y agoFakes also make integration testing easier too - if you want to focus on say, making sure your payments always make it into the database correctly, integration testing across the medley becomes (relatively) trivial, even automatable.
- dustymcp 5y agoI could mock all day but it would not be any help since the api's we use are brittle its much more efficient to fail in a graceful way where you can recover than plastering the codebase with mocks of happy paths
- rictic 5y agosince both comments in response read it the same way, I suppose I was unclear I was arguing against mocks, and for only using fakes when you really have to, for hermeticity and performance