Ask HN: What is your ideal code coverage in terms of percentage?
Share what you think and why!
Share what you think and why!
Having core business logic covered will give you the confidence in fixing, refactoring, updating those key pieces of the application.
Personally in order of most to least code coverage as my own general rule: Safety critical code, embedded device, mobile application, desktop application than web application. Not because web isn't important, but it is far easier and cost effective to address issues.
I'd say the code coverage percentage (if you will) goes hand in hand with a few factors, criticality of the code, sophistication of the team and the business risk of errors (even from a marketing perspective).
I've worked on safety critical devices that should have had 100% code coverage that didn't, and worked on web based marketing apps where 100% code coverage was mandated because we lost money and customer confidence if any piece failed.
Personally I have seen a pattern with the more senior the team makeup, it seems like the less total code coverage but the testing is more thorough and targeted. I honestly think this goes more based on trust within the team then just pure time behind the keyboard. I have also seen it bite teams too, so not sure it is the "smart" choice.