3 ms·
In test cases where you extensively involve mocks, more often than not in my experience, you end up testing that your mocks do the thing you told them to.
by arcticbull 5y ago
In test cases where you extensively involve mocks, more often than not in my experience, you end up testing that your mocks do the thing you told them to.
- mikepurvis 5y agoYeah, particularly the case with a lot of "glue" type code that's really just passing stuff back and forth and not really making any decisions with it. I've always struggled to feel that mock-based testing in this scenario was anything other than busy-work.
- pstuart 5y agoYes, but the coverage numbers look great!
- arcticbull 5y agoDon’t even get me started on that as a metric lol. I will say going from 0-20% coverage is a lot more valuable than going from 70-90%
- smaudet 5y agoThe proper metric is tests/feature - most test code bases are so bad you can't even pick out what feature is being tested, due to a blind adherence to 'code coverage' It is the equivalent of spot checking a road 100 times for cracks but forgetting to make sure you put up stop signs at the intersections - I honestly believe if you are a tech lead or boss advocating this you should be fired on the spot for encouraging dangerous and malignant practices...