3 ms·
It's worse. You need two tests for every time your code should have had an if - maybe the fact that there isn't one is the bug. And if the same unit has multip
by Scarblac 7y ago
It's worse. You need two tests for every time your code should have had an if - maybe the fact that there isn't one is the bug.
And if the same unit has multiple branches, you need double the tests to cover all paths.
And that doesn't guarantee correctness, and it's only unit tests.
But the 50% was a number I vaguely recall from Code Complete.
- aasasd 7y ago> every time your code should have had an if Yeah, I should've probably clarified this, seeing as we're on the topic of correctness and pedantry. Personally I'm doing this in TDD style, before the code is written. And then while it's written, too. And for code that didn't have tests—the approach really helps catch bugs previously unknown.