Code coverage tools allow us to discover which specific lines of code in the system were executed during a test. When you are starting to add tests to a legacy application, it can be really useful to know your code coverage:
If you know that a line of code isn’t covered by your tests yet, you can see more clearly what kind of a characterization test you need to write.
If you know that a line of code is covered by your tests, you can be more confident in refactoring or changing it.
There is no built-in support in Cucumber for collecting code coverage statistics. Instead, you need to install the SimpleCov gem and add a couple of lines to your env.rb:
When your features finish running, ...