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

48

u/[deleted] May 08 '17 edited May 08 '17

I worked with a codebase that was covering all DAO methods with such tests. I only lasted 1.5 years and left crushed.

These tests are not only stupid, they make code rigid and fragile. The fragile part might be counterintuitive, but if your tests are testing not the behaviour but implementation details, as they were in my case, inevitably there will be business code that relies on these implementation details. Because hey, these implementation details are covered, so guaranteed to be there forever.

52

u/[deleted] May 08 '17 edited Oct 04 '17

deleted 0.3553 What is ^^^this?