Re:Fear makes you a worse programmer
by yellowapple on Monday April 08, 2024 @09:45PM
(#39975574)
I feel like if you're unable to get 99% coverage with that then there's probably some dead code that needs pruned.
As for hardware-related problems and race conditions, testing at a higher level of abstraction seems like it'd help more than it'd hurt - in the former case ensuring graceful handling as part of the tests, and in the latter case making the race conditions more likely to hit (and hopefully fix).
I see the OP as talking about “integration” style tests (say testing against an api) and not being able to capture all of the OS and similar edge case errors in the test. I do think this is a hard problem, particularly if you don’t design for it from the outset.
It’s a bit of the old classic “reading from the file never returns an ‘access denied’ error, until it does”. There’s ways and means, but let’s not pretend this is simple.
You don't need 99% coverage. You just need enough coverage to be able to refactor the thing without breaking it.
Re:Fear makes you a worse programmer
by shrimp_emoji on Tuesday April 09, 2024 @09:05AM
(#39978996)
I bet the reason they aim for 99% coverage is because they're using Python on JavaScript for some complex software, which means they've roped themselves into being their own compiler. Without all that test coverage, all the bugs are surprise runtime bugs, and the tests take the "surprise" part out.
I don't consider it a problem, but it is to those who want to see big numbers.