Hacker News new | past | comments | ask | show | jobs | submit login

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.




Fakes 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.


I 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


since 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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: