I believe in comprehensive code coverage
I believe in comprehensive code coverage. But, I don’t believe in mandating code coverage minimums.
Mandating 90% test coverage leads to the team gaming the coverage number, often via low quality tests.
I just want the team to consistently ask “is this well tested?”
To encourage automated testing without requiring minimum coverage, I prefer a simple bullet on the definition of done: “has comprehensive automated tests.”
This way, the team simply asks “are the tests for this new feature sufficient?”
A related law that sums up why mandating code coverage minimums is a problem:
“When a measure becomes a target, it ceases to be a good measure.”
- Goodhart’s Law