What's DAT Smell? Untangling and Weaving the Disjoint Assertion Tangle Test Smell
Monil Narang, Hang Du, James A. Jones
摘要
In this work, we characterize a novel test-code smell—Disjoint Assertion Tangle (DAT)—which occurs when a test method verifies multiple, logically unrelated behaviors that can be separated. We propose a program analysis-based approach that automatically detects DAT and refactors DAT tests into separate focused test methods. We implemented this approach as a tool called U2W. By separating unrelated testing logic, U2W enhances readability, maintainability, and fault localization, while exposing hidden test clones and duplicated code. It then seizes these opportunities by converting structurally similar tests into compact, parameterized unit tests (PUTs), reducing redundancy and enabling more scalable, extensible test designs. To evaluate our approach and tool, we conducted a number of evaluations: (1) a large-scale, quantitative study to study the prevalence of the test smell and the effects of their refactoring, (2) a user survey to assess developers’ opinions and preferences of the unrefactored and refactored test code, and (3) pull requests that were issued to original project maintainers to assess the acceptability of our refactorings. Our quantitative study was conducted on 42,334 tests across 49 open-source projects. We found the DAT smell in 95.9% of the subject projects, affecting an average of 8.59% of analyzed tests. In total, we identified and refactored 3,638 smelly tests, untangled them into 31,837 test-execution logics, and then weaved 14,343 of them into 1,713 extensible PUT methods. These refactorings reduced the executable test-code lines in smelly tests by an average of 36.33%. Our user survey involving 49 industrial and academic participants demonstrated strong preference for our refactored test cases over their original, unrefactored versions. Additionally, we submitted 19 pull requests based on our automated refactorings; 16 of these were accepted by project maintainers. These results suggest that U2W effectively improves test-suite quality, and validate our novel test smell aligns closely with developers’ intuitions and practices.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper5
- Debugging the performance of Maven's test isolation: experience reportPengyu Nie, Ahmet Çelik, Matthew Coley, Aleksandar Milicevic 等ISSTA 2020 · 被引用 16 次
- Systematically Producing Test Orders to Detect Order-Dependent Flaky TestsChengpeng Li, Mohammad Mahdi Khosravi, Wing Lam, August ShiISSTA 2023 · 被引用 10 次
- Ripples of a Mutation - An Empirical Study of Propagation Effects in Mutation TestingHang Du, Vijay Krishna Palepu, James A. JonesICSE 2024 · 被引用 6 次
- Reducing Test Runtime by Transforming Test FixturesChengpeng Li, Abdelrahman Baz, August ShiASE 2024 · 被引用 1 次
- Leveraging Propagated Infection to Crossfire MutantsHang Du, Vijay Krishna Palepu, James A. JonesICSE 2025 · 被引用 1 次
相关 Paper
- Paired Code Smells and Test Smells: A Fine-Grained Longitudinal Empirical StudyZiwen CaiISSTA 2026
- Automated Unit Test RefactoringYi Gao, Xing Hu, Xiaohu Yang, Xin XiaFSE 2025 · 被引用 6 次
- PyNose: A Test Smell Detector For PythonTongjie Wang, Yaroslav Golubev, Oleg Smirnov, Jiawei Li 等ASE 2021 · 被引用 44 次
- Testability Refactoring in Pull Requests: Patterns and TrendsPavel Reich, Walid MaalejICSE 2023 · 被引用 4 次
- MUT: Human-in-the-Loop Unit Test MigrationYi Gao, Xing Hu, Tongtong Xu, Xin Xia 等ICSE 2024 · 被引用 3 次
