Paired Code Smells and Test Smells: A Fine-Grained Longitudinal Empirical Study
Ziwen Cai
Key points
From the paper's conclusion- 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.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Exploring Test Smells Across Programming Languages: A Systematic Mapping StudyarXiv · 2026
- Empirical study on the correlation among architectural smellsInformation and Software Technology · 2026
- Beyond Methods: An Empirical Study of File-Level Production-Test Co-evolution and Its Implications for AutomationACM Transactions on Software Engineering and Methodology · 2026
- Beyond Predictive Performance: SHAP-Based Explanations and Alignment with Literature-Based Indicators in Code Smell DetectionInformation · 2026
- Enhancing LLM‐Based Code Smell Prediction Using Empirical Detection StrategiesConcurrency and Computation: Practice and Experience · 2026
- Software Refactoring Research with Large Language Models: A Systematic Literature ReviewarXiv · 2026