Node.js Code Coverage Data Paying Dividends
If you want to improve, having the right data is often critical.It has been 3 months since nightly code coverage runs were added to the Node.js project (12 October 2016). You can see the nightly runs here: https://coverage.nodejs.org/ .
Looking at the results we can see that we’ve made progress since that time:
C++ coverage:88.3% -> 89.2% + 0.9%
Over the last 3 months I’ve seen a number of PRs submitted which were focused specifically on improving the coverage numbers and this is a good way to start contributing to node core. Find a test, look at the coverage and figure out how to make it cover the missing statements, branches, functions or lines.
Work is also underway to make it easier to capture coverage data on your desktop, with being able to do it through ‘make coverage’ being the end goal . That should make it easier to iterate while working on improving coverage for tests.
So to sum up I think we are off to a good start in leveraging our coverage data.While having high code coverage does not necessary lead to quality code, making sure we have tests that cover the important parts of the code we write is important. Having the data to easily look at what our tests exercise is one tool to let us evaluate how well we are doing.