this post was submitted on 14 Aug 2023
35 points (100.0% liked)
Experienced Devs
3981 readers
1 users here now
A community for discussion amongst professional software developers.
Posts should be relevant to those well into their careers.
For those looking to break into the industry, are hustling for their first job, or have just started their career and are looking for advice, check out:
- Logo base by Delapouite under CC BY 3.0 with modifications to add a gradient
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Well, optimally you really shouldn't have to refactor to test something. If you need that, it means you can't freely design your code for its function, and that the tests will break if you refactor again. You may be pushing tests that make your developers lives worse instead of better.
That said, yeah, some times one has to let go of the cleaner options and go punch the problem up until it's solved. That happens often with tests. if that's the case, you will need to do it through coercion. There are many tools that verify that tests are written, by more metrics than code coverage (but not any insightful metric). I'd pick a minimum of those and place them as a requirement.