And that's why we have code review process, and senior software engineers?
---
EDIT: add an example
When you look at a body of function and think if someone else changes some codes and you will have a hard time figuring out what goes wrong, that, the time you need to add some tests to it. Often it's a function that took numbers of iteration to work as you expect, or a function that is not simple but look so easy you write it right in one go.
And (this gets into personal opinions) sacrificing depth on tests on critical codepaths in order to spend time getting to 100% coverage is also stupid.
Time is finite. Money is finite. 100% coverage provides nothing but false assurances and pretty green metric lights.
It's easy to get "100% code coverage" for the below function:
def nths(number: int, divisor: int) -> float:
return number/divisor
def test_nths():
assert nths(1, 1) == 1
Yet it's obvious that test is not really taking care of anything.What you need is 100% semantic coverage, i.e. your tests should cover all potential outcomes of the code at appropriate levels.