What can be alternative metrics to code coverage?

后端 未结 15 739
迷失自我
迷失自我 2021-01-30 10:00

Code coverage is propably the most controversial code metric. Some say, you have to reach 80% code coverage, other say, it\'s superficial and does not say anything about your te

15条回答
  •  旧巷少年郎
    2021-01-30 10:20

    What about watching the trend of code coverage during your project?

    As it is the case with many other metrics a single number does not say very much.

    For example it is hard to tell wether there is a problem if "we have a Checkstyle rules compliance of 78.765432%". If yesterday's compliance was 100%, we are definitely in trouble. If it was 50% yesterday, we are probably doing a good job.

    I alway get nervous when code coverage has gotten lower and lower over time. There are cases when this is okay, so you cannot turn off your head when looking at charts and numbers.

    BTW, sonar (http://sonar.codehaus.org/) is a great tool for watching trends.

提交回复
热议问题