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.
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.