Test Smells 20 Years Later: Detectability, Validity, and Reliability

A. Panichella, Sebastiano Panichella, Gordon Fraser, Anand Ashok Sawant, Vincent Hellendoorn

Research output: Contribution to journalArticleScientificpeer-review

7 Citations (Scopus)
175 Downloads (Pure)

Abstract

Test smells aim to capture design issues in test code that reduces its maintainability. These have been extensively studied and generally found quite prevalent in both human-written and automatically generated test-cases. However, most evidence of prevalence is based on specific static detection rules. Although those are based on the original, conceptual definitions of the various test smells, recent empirical studies indicate that developers perceive warnings raised by detection tools as overly strict and non-representative of the maintainability and quality of test suites.
This leads us to re-assess test smell detection tools' detection accuracy and investigate the prevalence and detectability of test smells more broadly.
Specifically, we construct a hand-annotated dataset spanning hundreds of test suites both written by developers and generated by two test generation tools (EvoSuite and JTExpert) and performed a multi-stage, cross-validated manual analysis to identify the presence of six types of test smells in these. We then use this manual labeling to benchmark the performance and external validity of two test smell detection tools -- one widely used in prior work and one recently introduced with the express goal to match developer perceptions of test smells.
Our results primarily show that the current vocabulary of test smells is highly mismatched to real concerns: multiple smells were ubiquitous on developer-written tests but virtually never correlated with semantic or maintainability flaws; machine-generated tests actually often scored better, but in reality, suffered from a host of problems not well-captured by current test smells. Current test smell detection strategies poorly characterized the issues in these automatically generated test suites; in particular, the older tool's detection strategies misclassified over 70% of test smells, both missing real instances (false negatives) and marking many smell-free tests as smelly (false positives). We identify common patterns in these tests that can be used to improve the tools, refine and update the definition of certain test smells, and highlight as of yet uncharacterized issues. Our findings suggest the need for (i) more appropriate metrics to match development practice, (ii) more accurate detection strategies to be evaluated primarily in industrial contexts.
Original languageEnglish
Article number170
JournalEmpirical Software Engineering
Volume27
Issue number7
DOIs
Publication statusPublished - 2022

Keywords

  • Test Case Generation
  • Test Smells
  • Software Testing
  • software maintenance
  • Software Quality

Fingerprint

Dive into the research topics of 'Test Smells 20 Years Later: Detectability, Validity, and Reliability'. Together they form a unique fingerprint.
  • Revisiting Test Smells in Automatically Generated Tests: Limitations, Pitfalls, and Opportunities

    Panichella, A., Panichella, S., Fraser, G., Sawant, A. A. & Hellendoorn, V. J., 2020, Proceedings - 2020 IEEE International Conference on Software Maintenance and Evolution, ICSME 2020. Adelaide, Australia, Australia: IEEE, p. 523-533 11 p. 9240691. (Proceedings - 2020 IEEE International Conference on Software Maintenance and Evolution, ICSME 2020).

    Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

    Open Access
    File
    19 Citations (Scopus)
    153 Downloads (Pure)

Cite this