195 points · by nrsapt · 5y ago · 19 comments
There’s nothing groundbreaking for seasoned engineers but it serves as a very robust set of reminders, especially the secondary and tertiary elements that often fall off when projects get stressed to move faster/cheaper/more featured.
Also important that this isn’t Microsoft’s home grown process - rather an amalgamation of working with hundreds of companies - some tech companies, many not - with wide ranges of software engineering maturity. It’s also written and maintained by the engineers directly and with a singular purpose. No marketing, no fluff, no technology or vendor implementations.
I also liked the writing style guides that Microsoft and Google put out in recent years:
I disagree strongly with “90%+ unit test coverage” though. Diminishing returns are very real there.
Hi, stupid junior here. Can you elaborate a bit or give me some reading material? I'm currently struggling to get good practices with tests and understanding associated metrics. Thank you!
https://testing.googleblog.com/2010/07/code-coverage-goal-80...
That said, it's very easy to write tests that produce high code coverage, but do not test much that is useful (do they assert the things we truly need to check for?). It's also a pointless exercise to try and cover every single branch (e.g. does every defensive error check need to be asserted on?)
It's a delicate balance and I'm sure some people will disagree with this, even.
Parent post is right that lower coverage degrades rapidly... the difference between 65% and 75% is huge. But the ancestor post is right that there’s large diminishing returns too.
I’ll qualify this with recommending leaning hard into lints and type checkers and the like. Eliminating whole classes of errors gives the edge; rather than writing test cases in, say, Python to ensure that a string-mangling function raises the “correct” exception if passed an int… just enforce mypy checking instead. And then get your type coverage up to 75-80 percent. Fuzzers too. Get more overall coverage by letting the computer do the work.
I’ve seen enough 100% or close to completely broken applications.
Major business rules need tests too, but they are much harder to write - so we get high unit test coverage and not hard conversations about test quality.
>able to change logging level without code changes
The folks at Suckless would like a word. ;-)
Personally, I think having to recompile software just to change settings is a royal pain in the butt.