2 ms·
Let's be honest, though. Most developers who've had a test coverage metric goal imposed on them still write the code first, then they write just enough test cod
by cratermoon 3y ago
Let's be honest, though. Most developers who've had a test coverage metric goal imposed on them still write the code first, then they write just enough test code to exercise all of it. Maybe, if they're clever, they will delete a little bit of unused code here and there, like some error checks. No need to test if a check for null pointer is ever called, if you just delete the check.
Come to think of it, given how often catastrophic failures can be traced to untested and broken error handling code[1], maybe it's better if the code flat out blows up, rather than trying to limp along after some error it can't really do much about.
1 https://www.eecg.utoronto.ca/~yuan/papers/failure_analysis_osdi14.pdf https://www.eecg.utoronto.ca/~yuan/papers/failure_analysis_o...