Introducing code coverage reports in your test stack

How can we know how far our tests go on testing the application? Are we sure we are not leaving any piece of code untested and if so, is it relevant? How can we detect the pieces of code that fall outside the scope of our current tests so we can better assess whether they are worth testing or not?

These concerns can be easily addressed by introducing code coverage reporting in our application tests stack. A code coverage tool aims to track down the scope of our unit testing layer and produce an educated report informing you of the overall reach of your test specs and what pieces of code still remain uncovered.

There are several tools for implementing code coverage analysis in our applications, the most popular ones at this time being Blanket (http://blanketjs.org) and Istanbul (https://gotwarlost.github.io/istanbul). In both cases, the installation process is pretty quick and easy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset