Manchester UNI Search Quality Linked To Code Coverage
Manchester UNI Search Quality Linked To Code Coverage
Abstract—A good test suite is vital for minimising errors, and Number of local Methods (NOM), an indicator of interface
ensuring that software is easy to maintain. Another factor viewed complexity, measures the number of methods locally declared
as being important for the success and longevity of software is in a class. As the interface grows, the class usually becomes
code quality. We report on work examining whether there is a more complex, and consequently more difficult to test.
correlation between code quality and test coverage, using seven
different metrics: lines of code, McCabe’s cyclomatic complexity, McCabe’s Cyclomatic Complexity (CC), is a frequently
number of local methods, depth of inheritance tree, coupling used measure of structural complexity. It calculates the com-
between objects, improvement of lack of cohesion in methods plexity of a software entity through the number of paths that
and lack of documentation. could be taken within it. As the number of paths increases,
An analysis of three large, open source Java projects showed the control flow usually becomes more complex and therefore
that all of the response variables had a modest but significant more difficult to test.
relationship with line coverage, and a stronger relationship with
branch coverage: as coverage rose, so did software quality. We Depth of Inheritance Tree (DIT) was selected because
propose that writing tests may help people to adopt a ‘software inheritance is a basic yet powerful concept of object oriented
quality’ mindset, by encouraging them to think about how code languages. DIT calculates the complexity of a software entity
will be used as it is written. Testing may improve software based on the distance between a node and its root down the in-
sustainability not only by helping to ensure code does not regress, heritance tree [2]. As the code goes down the inheritance tree,
but also by supporting developers in adopting good software the control flow becomes more complex, and consequently
engineering practices. more difficult to test.