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

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.

主站蜘蛛池模板: 台南市| 关岭| 大安市| 漠河县| 志丹县| 兰西县| 昌黎县| 铁岭县| 绵阳市| 名山县| 芷江| 临沭县| 惠来县| 重庆市| 三河市| 天台县| 临邑县| 霞浦县| 蒙城县| 建湖县| 莱州市| 中阳县| 灵璧县| 武乡县| 铜鼓县| 灵寿县| 天水市| 南澳县| 化德县| 巴中市| 蛟河市| 姚安县| 石台县| 屯昌县| 石楼县| 灵宝市| 同德县| 石首市| 清河县| 三都| 简阳市|