News for hackers. Stuff that matters.
Re:Software Testing Anti-patterns by flukus on Sunday April 22, 2018 @08:39PM (#16899636)
> but too much DRY in tests can make for hard-to-modify spaghetti

This applies to all code, not just tests. Dry can turn some stupidly simple if somewhat repetitive code into a complicated mess.

For unit tests though, as I general rule I don't share any setup between tests but I use the test fixture setup method for common mocks to return default answers. Even that can get too hairy at times and it's better off creating a second test fixture.

There are no comments on this comment yet.