Istanbul is another code quality tool we use here at TRYTN to ensure quality builds are released to production. Istanbul allows for code instrumentation so that you can see which lines of code a test is executing. From this code coverage reports can be generated. The specific flavor of Istanbul that we utilize at TRYTN is a Babel plugin fork.
Unit and integration testing is great but it only goes so far. You also need to know what code is being tested, and more importantly, what code is not being tested. Gaps in unit and integration tests make room for potential bugs to be released in the future. That is where Istanbul comes into play. With Istanbul we receive a code coverage report that is interactive. With this report we can see how many times each line of code is being executed by our tests so we can write additional tests to cover gaps.
Istanbul generates several reports for us: summary and verbose reports in the build process for the console, HTML report for the interactive line-by-line analysis, and a TRX report for our build process to pick up and report from.
While code coverage is a standard way to track if testing is adequate it’s not the only solution. We promote testing to meet test cases and don’t require a specific code coverage percentage to meet. Therefore many times a line of code will be tested repeatedly even though it’s already considered covered by the code coverage report. It’s another way to ensure that all test cases are covered.
Likewise when bugs do happen, once the bug cause is identified, we are able to add in even more checks and test cases so that the bug will not be reproduced again in the future.
Package Name: Istanbul