What can be alternative metrics to code coverage?

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

    Using code coverage on it's own is mostly pointless, it gives you only insight if you are looking for unnecessary code.

    Using it together with unit-tests and aiming for 100% coverage will tell you that all the 'tested' parts (assumed it was all successfully too) work as specified in the unit-test.

    Writing unit-tests from a technical design/functional design, having 100% coverage and 100% successful tests will tell you that the program is working like described in the documentation.

    Now the only thing you need is good documentation, especially the functional design, a programmer should not write that unless (s)he is an expert of that specific field.

提交回复
热议问题