Visualising the data behind test coverage
Charting the historical test coverage performance of the main application for each marge of a feature brain to main. For each of the main coverage themes of Statements, Functions, Lines and Branches this displays a total percentage of lines covered, rendered inside an area-range detailing the total number of themes in the codebase, and how much is covered by tests.
For those perhaps less familiar with what the meaning of these themes are in the context of the code-base; consider each of these to be:
- Function Coverage is a measure of how many of the subroutines or functions within the codebase been called at least once within the unit tests.
- Branch Coverage details the extent to which the edges of the program have been interrogated. Essentially a measure of how many possible routes though the code are covered - for example given an
if (x==y)statement have both thetrueandfalseoutcomes been executed within the test. - Lines The Ronseal Wood Stain of types. Describes exactly what it says on the tin; namely what proportion of executable lines in the sources code have been touched by one of more of the unit tests.
- Statement Coverage because a single line can contain more than one executable element, these metrics detail whether or not every part of a line is covered.
Where particular milestones in the release versions, these are marked in the chart with a numerical annotation plotted at the upper edge of the x-axis. A more detailed description to the changes made to effect shifts in the metric figures in that released are documented below.
-
0.27.9: Prior to this release a number of utility methods - such as
Collection.asyncForEachwere needlessly being covered by unit tests within this repository. As the functionality is provided by the package@project-beardy/utils(which has it's own unit test coverage) the local tests for these were removed. This results in a notable drop in the number of files unit tests were touching -
0.28.8: Work undertaken to add additional methods to the
LocalUserservice refactored the existing unit tests already implemented for this class. More robust testing for potential error states mean number not only does total numberof tests increase, but also ensures some of the previously untouched errors of the code base are now covered -
0.28.10: A small update to the
Jestconfiguration allowed for the filtering out of any applicationviewtype classes from being included in the figures for unit test coverage.As this code largely relates to visual UI elements, these are covered by coverage metrics generated by the
Cypressautomation tests. It therefore makes sense for them to be discounted as no unit test will practially touch these parts of the code.This means that whilst it appears the amount of testing has dropped, in fact because proportionaly the coverage tests have over code has jumped significantly is an indication to the actual quality of coverage.