3 ms·
Sometimes there's a disconnect between what you think you're testing and what you're actually testing. After writing a unit test, I like to look at the code co
by cornstalks 11y ago
Sometimes there's a disconnect between what you think you're testing and what you're actually testing.
After writing a unit test, I like to look at the code coverage analysis for that unit test and see if it actually tests the code that I think it tests. After seeing the analysis, sometimes I realize I'm not testing for a weird corner case that I should be.
It also slightly gamifies unit testing because there's something slightly satisfying in seeing 100% code coverage (though it's important to remember that 100% code coverage doesn't necessarily mean your tests are perfect or test all the conditions you should be).