This is the first of a two-post series in which we try to understand how code coverage is measured and reported in JavaScript by building a simple code coverage tool ourselves. You can find the second post here and the reference code for this exercise here.
I have always been fascinated by the idea of being able to measure code quality. Recently, I had a chance to dig in and understand how a code coverage tool works under the hood. It was a fun exercise — so, I thought that I’ll share.
Code Coverage is a measure of the percentage of your codebase covered by your test-suite. It is a simple metric but arguably a strong indicator of code quality.