Applying code coverage measurement to your team's software development practices is worth the effort. Teams that focus on code coverage can know about their code quality. This awareness brings added pressure to write software that can be delivered on time, on budget, and to specified quality standards. Understanding code quality can reduce the pressures of time and cost from unforeseen bugs; it can also help improve team performance. Most importantly, quality code improves customer experience, satisfaction, and retention.
The Importance of Measurability
It's difficult to improve something that can't be measured. With code quality this is especially true. In the typical software development environment, two quality measurements are typically used:
- The number of tests that have been written
- The amount of time and money spent to resolve issues
Measuring quality based on the number of tests written is an obvious fallacy. It doesn't take into account the quality of the tests. Measuring quality in terms of issues reported leaves your team helpless, waiting to find out the verdict on a release after the fact rather than feeling confident going into the release.
Code coverage is one of many different metrics that can help teams measure the quality of their code before shipping by ensuring that every piece of code has been tested. While simply testing a line of code does not ensure that it meets its requirements, it does ensure that it has been thought about by its developer. Beyond simply measuring coverage, NCover also helps teams measure progress toward quality goals, measure the impact of changes to the code, and provide evidence of quality to stakeholders outside of the team.
Measuring Progress
Looking at the change in different quality metrics tells teams that they're moving in the right direction, and how quickly that progress is happening. The easiest way to measure a team's progress is by viewing key statistics in a graph. In Complete Edition, both NCover Explorer and NCover's full html report display trend graphs that help developers know what progress has been made and what rate coverage is improving at.
Monitoring The Impact Of Code Changes
Another huge benefit of measuring code coverage on projects is monitoring the effect that changes to code have on overall code coverage. For example, if an issue comes through where a critical portion of code is going to need to be adjusted, the typical team would implement the change and ensure that all tests pass. Just running the tests, though, does not make clear the effect that the change has had on the quality of a test suite. By looking at the effect that a code change has on code coverage, though, a team can ensure that the impact of code changes are understood and that the risk of issues arising due to changes can be reduced. NCover's satisfactory coverage thresholds help developers ensure that no changes impact the quality of the project to too great an extent by failing any build that goes beneath the team's predefined threshold.
Accountability
In almost every environment there is some party such as a customer, client, or stakeholder that is external to the development team but whose interests lie in the success of the team. Code coverage provides an easy way for developers and managers to communicate the quality of the software being developed to those outside parties. That could take the form of simply communicating that the team has verified that every line of code is tested, but it can also go so far as sharing NCover reports with stakeholders to show clear evidence that the software is being developed with quality in mind.
Moving Forward With Quality
It's important that every team have some way of communicating and improving their code's quality. NCover is a great way to allow teams to share and analyze hard numerical evidence of the quality of their code, and reduce the fear that often arises before shipping software. Using trends, reports, and the other analysis tools that are part of NCover, teams can not only ship on time and within budget, but do so with amazing quality code.