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

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.

主站蜘蛛池模板: 神农架林区| 南通市| 黄山市| 谷城县| 克拉玛依市| 绥德县| 宣武区| 来安县| 洮南市| 剑阁县| 长春市| 合川市| 静安区| 宁南县| 普陀区| 建瓯市| 武山县| 宜丰县| 泽普县| 东乡县| 揭阳市| 西藏| 清徐县| 泰安市| 恩施市| 富平县| 万全县| 青田县| 德化县| 邓州市| 北海市| 龙门县| 凤凰县| 庆云县| 萍乡市| 祁门县| 涿州市| 宝应县| 庄河市| 汽车| 搜索|