Paired Code Smells and Test Smells: A Fine-Grained Longitudinal Empirical Study
Ziwen Cai
Abstract
As software systems grow in complexity, ensuring maintainability is essential, but often hindered by various quality issues. Among them, code smells and test smells are widely recognized indicators of technical debt that degrade system quality. While production code and test suites are intrinsically coupled and evolve together, existing research predominantly studies code smells and test smells in isolation, ignoring their underlying connection over time. To bridge this gap, this paper presents a fine-grained longitudinal study on the co-evolutionary dynamics of "paired smells", which refer to cases where code and test smells exist concurrently in linked production and test code. By analyzing 128,417 commits across 19 long-lived open-source Java repositories, we investigate the statistical associations, survival lifespans, and removal motivations of these paired flaws. As a result, we identify 30 statistically significant rules where specific test smells imply the presence of underlying production code smells and our survival analysis reveals that in most repositories, paired smells have relatively shorter lifespans than unpaired ones. To explain this phenomenon, our manual inspection reveals that paired smells often signal deeper structural issues, prompting explicit risk-driven refactoring. Finally, we discuss the implications of these results for code quality analysis and continuous integration tools, suggesting that they should link related smell findings between production and test code and guide synchronized refactoring.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 39b98305-5c29-40b9-80cf-c3981ebbf7f3Related papers
- What's DAT Smell? Untangling and Weaving the Disjoint Assertion Tangle Test SmellMonil Narang, Hang Du, James A. JonesASE 2025
- How disabled tests manifest in test maintainability challenges?Dong Jae Kim, Bo Yang, Jinqiu Yang, Tse-Hsun (Peter) ChenFSE 2021 · 9 citations
- Causal or Correlational? A Cohort Study on the Effects of Code Smells on Class Change- and Fault-PronenessSabato Nocera, Sira Vegas, Giuseppe Scanniello, Massimiliano Di Penta et al.ICSE 2026 · 1 citation
- Evaluating Unit Testing Practices in R PackagesMelina C. VidoniICSE 2021 · 14 citations
- The Design Smells Breaking the Boundary between Android Variants and AOSPWuxia Jin, Jiaowei Shang, Jianguo Zheng, Mengjie Sun et al.ICSE 2025
