3 ms·
This is my experience too. Realism in testing is criminally underrated while code coverage is criminally overrated. IME unit tests can only effectively substit
by crdoconnor 7y ago
This is my experience too. Realism in testing is criminally underrated while code coverage is criminally overrated.
IME unit tests can only effectively substitute for integration tests where you're testing logical/algorithmic code with simple function inputs/outputs.
- 0xB31B1B 7y agoI somewhat agree, somewhat disagree. IMO the largest value I get from unit tests is the confidence that I can make changes and understand what breaks. Refactoring w/o unit tests makes me feel like I am flying blind
- closeparen 7y agoThe units we test are almost never big enough for internal refactoring. It’s the decomposition into units that wants refactoring, and there the test suite actively fights back (mock expectations in particular). If there were enough code involved in a test that we could meaningfully refactor it while keeping the test green, we would call it an integration test.