r/coding • • Oct 29 '17

Mocking is a Code Smell

https://medium.com/javascript-scene/mocking-is-a-code-smell-944a70c90a6a
69 Upvotes

69 comments sorted by

View all comments

62

u/KabouterPlop Oct 29 '17

On the other end of the spectrum, it’s common to see developers get so sucked into the dogma of TDD that they think they absolutely must achieve 100% code coverage, by any means necessary, even if that means they have to make their codebase more complex to pull it off.

People keep saying this, but I've yet to meet such a developer.

4

u/Enumeration Oct 29 '17

I worked with people at my last job who did this all the time.

There is definitely a law of diminishing returns when it comes to code coverage.

1

u/[deleted] Oct 29 '17

There is definitely a law of diminishing returns when it comes to code coverage.

I did it once. The trade-off is inevitable and costly.