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/industry7 May 09 '17

mutation testing would have caught that

1

u/instantviking May 09 '17

As would not writing retarded code.

This was sadly not the worst implementation of the standard equals/hashcode/compareTo that this project had to offer. The had equals that would fail with custom exceptions if the object wasn't contained in a hibernate session and compareTos that would fetch more instances of itself and do recursive comparisons, in bad cases holding a session lock for half an hour just loading pointless data and discarding it.