Using the coverage tool, generate an HTML visual coverage report. This is useful because we can drill into the source code and see what lines were not exercised in the test procedures.
Reading a coverage report without reading the source code is not very useful. It may be tempting to compare two different projects based on the coverage percentages. But unless the actual code is analyzed, this type of comparison can lead to faulty conclusions about the quality of software.
With these steps, we will explore creating a nicely viewable HTML coverage report.
coverage.html
.htmlcov/index.html
using your favorite browser and inspect the overall report.The coverage tool has a built-in feature to generate an HTML report. This provides a powerful way to visually inspect the source code and see what lines were not executed.
By looking at this report, we can clearly see that the lines not executed involve the lack of clearing network events that are being processed. This can tip us off about another test case which involves clearing events that need to be drafted.