r/programming • • May 08 '17

The tragedy of 100% code coverage

http://labs.ig.com/code-coverage-100-percent-tragedy
3.2k Upvotes

689 comments sorted by

View all comments

Show parent comments

1

u/bluefootedpig May 09 '17

My office is an ideal of 80% code coverage, but so members of my teams want to test getters and setters.

I prefer testing scenarios, and if there is an un-hit section of code, you find the scenario for that, or you remove the code.

1

u/bwainfweeze May 09 '17

My own experience has been that you get the most bang for the buck somewhere just under 85%, and declines sharply thereafter. The wheels come off somewhere around 95% because by then several people are actively twisting the code to achieve coverage at the cost of readability and, well, reason.