2 ms·
I saw cases where there really was a waste of stupid unit tests, and no significant tests for the interaction of those units, so I can see where the author is c
by danmaz74 7y ago
I saw cases where there really was a waste of stupid unit tests, and no significant tests for the interaction of those units, so I can see where the author is coming from. But my conclusion, after many years of developing with different levels of testing, is that it's a good idea to:
* Have at least one unit test for each nontrivial unit, but no unit tests for the trivial ones. But, in these unit tests, use mocking and stubbing only when using real objects isn't feasible, or very inconvenient - isolation is nice to have, but generally overrated in my experience
* Create as many unit tests as necessary to feel confident about the edge cases for the most critical units
* Implement higher level tests covering the main use cases for the interaction of all the units