News for hackers. Stuff that matters.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by echelon on Tuesday August 29, 2023 @02:23PM (#37311818)
Fully agree.

I would add that you should duplicate the common, cross-cutting setup (eg. faked/mocked dependencies that don't matter), but make the test conditions themselves explicit.

You get a feel for the correct granularity the more tests you write within the codebase. If you try to be too clever in saving boilerplate, you'll cause pain for future modifications and maintainers. Sometimes fixing "clever" tests takes longer than the code change itself.

There are no comments on this comment yet.