Re:DRY is an over-rated programming principle?
by michaelcampbell on Thursday July 07, 2022 @10:17AM
(#32014414)
Tests in particular SHOULDN'T be DRY, IMO. They need to be very much independently modifiable quickly; they're meant to be quirky end-runs around your bespoke, artisinal architecture to get at all the interesting bits. Repetition there is fine.
[ Parent
| on HN ]
Re:DRY is an over-rated programming principle?
by bcrosby95 on Thursday July 07, 2022 @12:55PM
(#32016415)
I dunno. I think a few helper methods helps a lot in tests - like if you have a common operation in the setup portion. I don't think the code needs to be super abstract, but it shouldn't all be hand typed out.
Re:DRY is an over-rated programming principle?
by baobabKoodaa on Thursday July 07, 2022 @12:43PM
(#32016271)
A downside of this approach is that sometimes when you make a small implementation change, you need to rewrite 50 unit tests.