What can be alternative metrics to code coverage?

后端 未结 15 710
迷失自我
迷失自我 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:06

    Probably not only measuring the code covered (touched) by the unit tests but how good the assertions are.

    One metric easy to implement is to measure the size of the Assert.AreEqual

    You can create your own Assert implementation calling Assert.AreEqual and measuring the size of the object passed as second parameter.

提交回复
热议问题