Let’s face it: unused code has no place in your product. It’s similar to the proverbial junk drawer at your home, but instead of a messy cabinet your users are quite literally paying this code.

This of course begets an interesting question, which is do you know how much code is unused in your application? If you’re similar to me the answer is likely not. To make matters worse it’s either impossible or costly to acquire. Chrome 59, however, now comes with the ability to capture coverage out-of-the-box. Be prepared for a little shock once you get it working, as I was:

All this red 😱

As amazing as this ability is, the tool is cursed with most things in the browser, and that is that automation can be extremely challenging. Consider all the steps one has to hurdle through in order to get these statistics:

Start a browser. Load our page/app. Restart the page to begin coverage instrumentation. Do some form of interaction or run through a use-case. Repeat Step 4 n-times to cover all your apps use-cases. Find the buried coverage tab and see how bad things are.

Given the nature of all the various workflows and opportunities for human-error, you can clearly see that this won’t scale well. Which is where Navalia comes in to rescue us.