An empirical analysis of the distribution of unit test smells and their impact on software maintenance

  • Authors:
  • Rocco Oliveto;Andrea De Lucia;Abdallah Qusef;David Binkley;Gabriele Bavota

  • Affiliations:
  • University of Molise, Pesche (IS), Italy;University of Salerno, Fisciano (SA), Italy;University of Salerno, Fisciano (SA), Italy;Loyola University Maryland, Baltimore, USA;University of Salerno, Fisciano (SA), Italy

  • Venue:
  • ICSM '12 Proceedings of the 2012 IEEE International Conference on Software Maintenance (ICSM)
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Unit testing represents a key activity in software development and maintenance. Test suites with high internal quality facilitate maintenance activities, such as code comprehension and regression testing. Several guidelines have been proposed to help developers write good test suites. Unfortunately, such rules are not always followed resulting in the presence of bad test code smells (or simply test smells). Test smells have been defined as poorly designed tests and their presence may negatively affect the maintainability of test suites and production code. Despite the many studies that address code smells in general, until now there has been no empirical evidence regarding test smells (i) distribution in software systems nor (ii) their impact on the maintainability of software systems. This paper fills this gap by presenting two empirical studies. The first study is an exploratory analysis of 18 software systems (two industrial and 16 open source) aimed at analyzing the distribution of test smells in source code. The second study, a controlled experiment involving twenty master students, is aimed at analyzing whether the presence of test smells affects the comprehension of source code during software maintenance. The results show that (i) test smells are widely spread throughout the software systems studied and (ii) most of the test smells have a strong negative impact on the comprehensibility of test suites and production code.