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

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.

主站蜘蛛池模板: 思茅市| 河东区| 托克托县| 海门市| 双城市| 改则县| 武夷山市| 米林县| 灵璧县| 林周县| 屏东县| 韶山市| 巧家县| 河津市| 营口市| 桃源县| 吐鲁番市| 芜湖县| 怀宁县| 汪清县| 抚松县| 新余市| 民权县| 嘉峪关市| 合作市| 赤峰市| 手机| 辉南县| 台东县| 东乡族自治县| 龙泉市| 宁城县| 洛浦县| 昌宁县| 罗田县| 安徽省| 广河县| 宜春市| 崇信县| 随州市| 广丰县|