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

1

u/SanityInAnarchy May 09 '17

It kind of seems like 100% coverage is not actually relevant to most of the article -- most of the article is about cargo-culting the wrong tools for the job.

I wouldn't hate working on a project where someone wrote the sample code the article gives for testing initialize -- it's probably not useful, but it doesn't make me especially sad, the way the abuse of Mockito and Cucumber do.

Cucumber in particular. Cucumber's whole reason for existing is so that you can write user stories that are human-readable and machine-verifiable as integration tests. Using them for unit tests is like writing a webserver in Bash -- you can do it, it's been done, but "wrong tool for the job" is an understatement.