News for hackers. Stuff that matters.
Re:Software development is a loser’s game by onion2k on Thursday April 01, 2021 @10:36AM (#26660992)
For a long time I've wondered if it'd be a good idea to have my deploys look at the test coverage and refuse to deploy if it falls below a threshold. I think it's a good idea but I know it'd annoy the hell out of me if I actually implemented it..
Re:Software development is a loser’s game by psidium on Thursday April 01, 2021 @10:56AM (#26661229)
Honestly it is hard going from no code-coverage to a rule of at least x% of code coverage. Instead of adding a blunt rule I went with something different:

Some years ago I've implemented a check to fail the PRs if the lines touched on that PR don't have code coverage (delta-coverage = 100%). We aligned internally with all the affected developers and went with it. We defined that the rule is that 100% of the code needs to be covered, but it doesn't mean that the rules can't have case-by-case exceptions. Whenever someone needs an exception the teams gets together and approve an exception. Sometimes it is a backlog to write the tests later, or some files that don't need unit tests altogether.

This may have worked for us because we are 5 years into this codebase and it keeps on growing, but for more small projects this may be more hassle than it is worth.

Honestly, after the first 6 months (not easy, not gonna lie) I felt better about the codebase, and I love the confidence of trying things and having unit tests all around. There were times where I submitted a PR and forgot altogether to write tests and this rule caught me.

I recommend it, but as with any software development practice, this is not a one-size-fits-all game.

Re:Software development is a loser’s game by varispeed on Thursday April 01, 2021 @10:41AM (#26661055)
This removes so much headache in the long run. Often by writing tests you discover something not considered before and that improves the product a lot and its stability. I have some projects that have been online for like 4 years now without reboot. They have very good coverage. I hate going through logs and debugging, and I almost never do it after committing to testing. Things just work.
Re:Software development is a loser’s game by exactlysolved on Thursday April 01, 2021 @10:41AM (#26661051)
I think error budgets are an excellent idea for this type of tension.

Release crap that breaks too often? OK, you have taken too much of another team's resources, and will have to release less and/or check your work much more carefully.

Release something that might look low quality to an outsider, but that actually works perfectly well? Fine - no negative consequences if nothing bad happens.

Re:Software development is a loser’s game by sidlls on Thursday April 01, 2021 @10:59AM (#26661265)
This is fine when errors have clear boundaries or the system is more or less trivial. It's easy to have clearly defined error budgets and assignment of blame. In more complicated systems (e.g. mature companies or complex architectures) the assignment of blame becomes problematic, and that makes the tool (error budgets) less useful.