Open Access
- 5 March 2024
- journal article
- research article
- Published by Springer Nature in Empirical Software Engineering
- Vol. 29 (2) , 1-44
Abstract
Test smells are symptoms of sub-optimal design choices adopted when developing test cases. Previous studies have proved their harmfulness for test code maintainability and effectiveness. Therefore, researchers have been proposing automated, heuristic-based techniques to detect them. However, the performance of these detectors is still limited and dependent on tunable thresholds. We design and experiment with a novel test smell detection approach based on machine learning to detect four test smells. First, we develop the largest dataset of manually-validated test smells to enable experimentation. Afterward, we train six machine learners and assess their capabilities in within- and cross-project scenarios. Finally, we compare the ML-based approach with state-of-the-art heuristic-based techniques. The key findings of the study report a negative result. The performance of the machine learning-based detector is significantly better than heuristic-based techniques, but none of the learners able to overcome an average F-Measure of 51%. We further elaborate and discuss the reasons behind this negative result through a qualitative investigation into the current issues and challenges that prevent the appropriate detection of test smells, which allowed us to catalog the next steps that the research community may pursue to improve test smell detection techniques.Keywords
All Related Versions
Funding Information
- Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung (PZ00P2_186090)
- Ministero dell’Istruzione, dell’Università e della Ricerca (2020W3A5FY)
This publication has 74 references indexed in Scilit:
- On the diffusion of test smells and their relationship with test code quality of Java projectsJournal of Software: Evolution and Process, 2023
- An extensive evaluation of ensemble techniques for software change predictionJournal of Software: Evolution and Process, 2019
- Multilayer Perceptron (MLP)2017
- Scikit-Learn2016
- The Art of Software Testing2012
- Cross-Validation2009
- Borderline-SMOTE: A New Over-Sampling Method in Imbalanced Data Sets Learning2005
- Search‐based software test data generation: a surveySoftware Testing, Verification and Reliability, 2004
- The use and interpretation of the Friedman test in the analysis of ordinal‐scale data in repeated measures designsPhysiotherapy Research International, 1996
- Selection Bias and Self-selection1990