4 ms·
I mostly agree with the thoughts on testing, and agree with the principle that unit test overkill is not constructive. I don't think 100% control path coverage
by dcw303 11y ago
I mostly agree with the thoughts on testing, and agree with the principle that unit test overkill is not constructive.
I don't think 100% control path coverage is hard to achieve though. If done correctly, it should not require an excessive number of tests. If your methods are so convoluted that covering every path is complicated, you probably need to split up your code further.
I name my test methods like this: test<MethodUnderTest><Assumption><Expectation>, e.g:
void testCalculateWithIncorrectFooIsNotValid()
Writing lots of tests that have ridiculous names is a code smell that I've overdone it on testing. Although this doesn't happen as much with statically typed languages, since the compiler does a lot of the work for you.