3 ms·
> the interfaces we’ve defined serve no practical purpose other than making unit testing possible That's actually almost never true - abstracting the sorts of
by commandlinefan 5y ago
> the interfaces we’ve defined serve no practical purpose other than making unit testing possible
That's actually almost never true - abstracting the sorts of external dependencies (like databases and web services) that actually cause problems for unit tests make the code more manageable in terms of maintenance and troubleshooting.
The problem is when people go mock-crazy and mock every class that the unit depends on. Rather, just mock the things that can actually make the unit test fail if they're unreachable for some reason independent of the actual code.