News for hackers. Stuff that matters.
Re:The evil unit test. by jrockway on Monday January 30, 2012 @05:16PM (#3530868)
For instance we had a rule at a place I worked, where we needed to have 80% unit test coverage. And what is described in this article happened. Anytime we'd make a small refactor, we'd have to go update 3-4 test libraries. And if it was a big one, then you have a lot of tests to update. And since some were complex (or since there were a lot of them) people didn't dig into that much. When people finally did it sometimes showed the test wasn't even testing what it was supposed to anymore.

This just means your tests are bad. Write good tests and you won't have this problem.

Integration and functional tests are good, but only as a quick sanity check. The nitty gritty details need to be handled by good unit tests; the functional tests only tell you things like "did the RPC protocol change" or "does the database cache actually cache something".

Re:The evil unit test. by RandallBrown on Monday January 30, 2012 @06:12PM (#3531021)
It is really easy to write bad tests. That doesn't mean that you shouldn't write any, but just "writing good tests" can be really hard.