Abstract
A good test suite is vital for minimising errors, and ensuring that software is easy to maintain. Another factor viewed as being important for the success and longevity of software is code quality. We report on work examining whether there is a correlation between code quality and test coverage, using seven different metrics: lines of code, McCabe's cyclomatic complexity, number of local methods, depth of inheritance tree, coupling between objects, improvement of lack of cohesion in methods and lack of documentation. An analysis of three large, open source Java projects showed that all of the response variables had a modest but significant relationship with line coverage, and a stronger relationship with branch coverage: as coverage rose, so did software quality. We propose that writing tests may help people to adopt a 'software quality' mindset, by encouraging them to think about how code will be used as it is written. Testing may improve software sustainability not only by helping to ensure code does not regress, but also by supporting developers in adopting good software engineering practices.
Original language | English |
---|---|
Publication status | Published - 26 Oct 2015 |
Event | International Workshop on Sustainable Software Systems Engineering - Liverpool Duration: 26 Oct 2015 → … |
Conference
Conference | International Workshop on Sustainable Software Systems Engineering |
---|---|
City | Liverpool |
Period | 26/10/15 → … |