4 ms·
If you make a code change that breaks one test and think it might be a broken test, it’s easier to read that test if it’s not dry. Because all of the dependenci
by pitched 5y ago
If you make a code change that breaks one test and think it might be a broken test, it’s easier to read that test if it’s not dry. Because all of the dependencies are listed out more explicitly.
Dry tests use a lot of helper methods and those are a layer of indirection. To understand a dry test, you have to also understand the helper methods, and whatever helpers they all call.
> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
- AzN1337c0d3r 5y ago> Dry tests use a lot of helper methods and those are a layer of indirection. This is exactly my point, you reduce noise. > To understand a dry test, you have to also understand the helper methods, and whatever helpers they all call. To understand your TEST SUITE, you understand all the helpers exactly once with DRY tests.
- pitched 5y agoI think the debate is whether it should be tuned to make it more accessible to yourself (code owner) or others (code owners of nearby systems). And the best advice is where we started: > use your best judgement