Abstract
Test smells are symptoms of sub-optimal design choices adopted when developing test cases. Previous research has demonstrated their harmfulness for test code maintainability and effectiveness, showing their impact on test code quality. As such, the quality of test cases affected by test smells is likely to deviate significantly from the quality of test cases not affected by any smell and might be classified as anomalies. In this paper, we challenge this observation by experimenting with three anomaly detection approaches based on machine learning, cluster analysis, and statistics to understand their effectiveness for the detection of four test smells, i.e., Eager Test, Mystery Guest, Resource Optimism, and Test Redundancy on 66 open-source Java projects. In addition, we compare our results with state-of-the-art heuristic-based and machine learning-based baselines. Our ultimate goal is not to prove that anomaly detection methods are better than existing approaches, but to objectively assess their effectiveness in this domain. The key findings of the study show that the F-Measure of anomaly detectors never exceeds 47%, obtained in the Eager Test detection using the statistical approach, while the Recall is generally higher for the statistical and clustering approaches. Nevertheless, the anomaly detection approaches have a higher Recall than the heuristic and machine learning-based techniques for all test smells. The low F-Measure values we observed for anomaly detectors provide valuable insights into the current limitations of anomaly detection in this context. We conclude our study by elaborating on and discussing the reasons behind these negative results through qualitative investigations. Our analysis shows that the detection of test smells could depend on the approach exploited, suggesting the feasibility of developing a meta-approach.
| Original language | English |
|---|---|
| Article number | 112320 |
| Number of pages | 21 |
| Journal | Journal of Systems and Software |
| Volume | 222 |
| DOIs | |
| Publication status | Published - Apr 2025 |
Bibliographical note
Publisher Copyright:© 2024
Keywords
- Test smells
- Anonaly detection
- Empirical software engineering
Fingerprint
Dive into the research topics of 'An Empirical Investigation into the Capabilities of Anomaly Detection Approaches for Test Smell Detection'. Together they form a unique fingerprint.Projects
- 1 Active
-
FWOSBO47: SBO Project : BaseCamp Zero - Towards Zero-Touch Testing
De Roover, C. (Administrative Promotor)
1/10/22 → 30/09/26
Project: Applied
Datasets
-
An Empirical Investigation into the Capabilities of Anomaly Detection Approaches for Test Smell Detection
Pontillo, V. (Creator), figshare, 31 Jul 2024
DOI: 10.6084/m9.figshare.24466336.v3
Dataset
Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver