Lune

ASE2025顶会

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Reducing Test Runtime by Transforming Test Fixtures 引用了 Debugging the performance of Maven's test isolation: experience report
  • Reducing Test Runtime by Transforming Test Fixtures 引用了 Systematically Producing Test Orders to Detect Order-Dependent Flaky Tests
  • Leveraging Propagated Infection to Crossfire Mutants 引用了 Ripples of a Mutation - An Empirical Study of Propagation Effects in Mutation Testing
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper5

  1. Debugging the performance of Maven's test isolation: experience reportPengyu Nie, Ahmet Çelik, Matthew Coley, Aleksandar Milicevic 等ISSTA 2020 · 16 次引用
  2. Systematically Producing Test Orders to Detect Order-Dependent Flaky TestsChengpeng Li, Mohammad Mahdi Khosravi, Wing Lam, August ShiISSTA 2023 · 10 次引用
  3. Ripples of a Mutation - An Empirical Study of Propagation Effects in Mutation TestingHang Du, Vijay Krishna Palepu, James A. JonesICSE 2024 · 6 次引用
  4. Reducing Test Runtime by Transforming Test FixturesChengpeng Li, Abdelrahman Baz, August ShiASE 2024 · 1 次引用
  5. Leveraging Propagated Infection to Crossfire MutantsHang Du, Vijay Krishna Palepu, James A. JonesICSE 2025 · 1 次引用

相关 Paper

  1. Paired Code Smells and Test Smells: A Fine-Grained Longitudinal Empirical StudyZiwen CaiISSTA 2026
  2. Automated Unit Test RefactoringYi Gao, Xing Hu, Xiaohu Yang, Xin XiaFSE 2025 · 6 次引用
  3. PyNose: A Test Smell Detector For PythonTongjie Wang, Yaroslav Golubev, Oleg Smirnov, Jiawei Li 等ASE 2021 · 44 次引用
  4. Testability Refactoring in Pull Requests: Patterns and TrendsPavel Reich, Walid MaalejICSE 2023 · 4 次引用
  5. MUT: Human-in-the-Loop Unit Test MigrationYi Gao, Xing Hu, Tongtong Xu, Xin Xia 等ICSE 2024 · 3 次引用
黄昏的海面,两侧是细线勾勒的悬崖