3 ms·
> With that out of the way, I would recommend using a test double in exactly one kind of situation: When it's genuinely awkward to use the real thing. THANK YO
by Person5478 6y ago
> With that out of the way, I would recommend using a test double in exactly one kind of situation: When it's genuinely awkward to use the real thing.
THANK YOU.
I'm actually pretty staunchly anti-mocking (and anything similar). I think too many developers start thinking of testing as the goal rather than as the means. What this means to me is I don't care if it's technically an integration test vs a unit test, I care that it tests _REALITY_.
There are times when the isolation given by mocking can be useful, but I submit it's useful far far less often than many claim. And your examples are a good use as well.
But imo trying to mock everything is mostly mental masturbation only with long-term maintenance costs.