Unit testing code coverage - do you have 100% coverage?

后端 未结 17 2729
离开以前
离开以前 2020-12-13 09:05

Do your unit tests constitute 100% code coverage? Yes or no, and why or why not.

17条回答
  •  一整个雨季
    2020-12-13 09:07

    Yes, I have had projects that have had 100% line coverage. See my answer to a similar question.

    You can get 100% line coverage, but as others have pointed out here on SO and elsewhere on the internet its maybe only a minimum. When you consider path and branch coverage, there's a lot more work to do.

    The other way of looking at it is to try to make your code so simple that its easy to get 100% line coverage.

提交回复
热议问题