3 ms·
I disagree. Unit tests, when done right, are heaps of ROI in my experience. Most of the integration tests are for happy paths, i.e. ones where you can catch th
by prerok 3y ago
I disagree. Unit tests, when done right, are heaps of ROI in my experience.
Most of the integration tests are for happy paths, i.e. ones where you can catch the obvious regressions. Testing corner cases is much more troublesome, because you have to set up a whole lot of specifics in multiple services. These are much easier to simulate with mocks.
Mind you, I hate unit tests for specific functions: I much prefer them as component tests, where you start with the inputs to the module and check the outputs and calls outside of the module. These ease refactoring where you actually change the underlying code and without changing the unit tests, you know that you also handled all those pesky corner cases.