I very much agree with James Coplien approach to unit tests:
- Keep unit tests that test key algorithms for which there is a broad, formal, independent oracle of correctness, and for which there is ascribable business value.
Though I'd say that for low-level code (without dependencies) there's basically no difference between unit/integration/e2e tests. They are just tests.
The only difference I found is that with unit tests people will also test implementation details. So it's still better to have integration test mindset even when your only option is unit tests.
Comments
I very much agree with James Coplien approach to unit tests:
- Keep unit tests that test key algorithms for which there is a broad, formal, independent oracle of correctness, and for which there is ascribable business value.
Though I'd say that for low-level code (without dependencies) there's basically no difference between unit/integration/e2e tests. They are just tests.
The only difference I found is that with unit tests people will also test implementation details. So it's still better to have integration test mindset even when your only option is unit tests.