官术网_书友最值得收藏!

Code coverage tools

The fact that we wrote tests does not mean that they are good, nor that they cover enough code. As soon as we start writing and running tests, the natural reaction is to start asking questions that were not available before. What parts of our code are properly tested? What are the cases that our tests did not take into account? Are we testing enough? These and other similar questions can be answered with code coverage tools. They can be used to identify the blocks or lines of code that were not covered by our tests; they can also calculate the percentage of code covered and provide other interesting metrics.

They are powerful tools used to obtain metrics and show relations between tests and implementation code. However, as with any other tool, their purpose needs to be clear. They do not provide information about quality, but only about which parts of our code have been tested.

Code coverage shows whether the code lines are reached during test execution, but it is not a guarantee of good testing practices because test quality is not included in these metrics.

Let's take a look at one of the most popular tools used to calculate code coverage.

主站蜘蛛池模板: 湖口县| 瑞安市| 左云县| 赤壁市| 平顶山市| 岳阳市| 罗江县| 安乡县| 辛集市| 来宾市| 徐州市| 仁布县| 南江县| 南汇区| 大荔县| 微山县| 汝南县| 甘孜| 永康市| 武乡县| 周口市| 铜川市| 榆社县| 吉安县| 武汉市| 兴业县| 岚皋县| 探索| 如东县| 连江县| 平乐县| 偏关县| 龙江县| 通榆县| 库尔勒市| 疏附县| 施秉县| 龙陵县| 京山县| 沧州市| 平利县|