4 ms·
So, which references would you point to? I've work in such environments. I've been bitten by mocks and I've been bitten by false positives from ugly E2E system
by ebiester 3y ago
So, which references would you point to?
I've work in such environments. I've been bitten by mocks and I've been bitten by false positives from ugly E2E systems. I've seen flaky E2E tests linger indefinitely, so I know why trying to spin up the whole system for a small set of tests is bad.
I also know that test data management and systems like VCR are very difficult to maintain. So, we mock because it's more painful to do otherwise. (That is; the test data management does not keep every edge case because it's extremely expensive to do so.)
Yet, the mocking is painful too in the complex system. There's no way to tell if the mock's response has been changed from underneath. You introduce false confidence in your code. Most bugs, in my experience, are based on a misalignment of expectations between two separate parts of the system (or internal/external systems.) Some of this is based on changes, others are based on unknown edge cases.
So, given that this is a hard problem, where do you point intermediate practitioners?
- wavemode 3y agoYou state unit tests and mocks do not catch all bugs. I absolutely agree with you. But the answer is not, to not do it at all. The answer is to test in multiple ways. Unit, integration, E2E, manual - how much of each you need depends on what kind of system you're building.