I've noticed this many times, or something like it, so I also have a higher tolerance for duplication in tests than in production code. The reason is that ideally unit tests are orthogonal, self-contained little stories about the system: "when you do this, then that, X happens". There is usually a lot of overlap between the "this" and "that" addressed by different tests; indeed there had better be, or simple combinatorics suggest you're missing cases. When you try to generalize all of this to eliminate the duplication, you end up with complex, abstract code that may be shorter overall but has lost the all-important property of being able to read a given test easily and understand what it is saying about the system.<p>I just remembered I wrote about this before: <a href="http://news.ycombinator.com/item?id=239167" rel="nofollow">http://news.ycombinator.com/item?id=239167</a> (searchyc ftw).