paperbot · PL 论文追踪

全部论文 待读 收藏

P2 What’s DAT Smell? Untangling and Weaving the Disjoint Assertion Tangle Test Smell

什么是 DAT 异味?解开并编织 Disjoint Assertion Tangle 测试异味
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 2/10 · 该论文属于程序分析与软件测试/重构方向,关注测试异味检测与自动重构,但未涉及 LLM/Agent、机器学习系统程序分析、浮点程序分析或贝叶斯程序分析等核心交叉方向,与用户研究画像匹配度很低。引用 0 inbox
Monil Narang, Hang Du, James A. Jones
crossref: 2026-09-12

AI 速览

一句话:提出 DAT 测试异味,并用程序分析自动检测与重构为聚焦测试及参数化单元测试。

论文刻画了一种新的测试代码异味——Disjoint Assertion Tangle(DAT),即单个测试方法验证多个逻辑上无关、可分离的行为。作者提出基于程序分析的自动检测与重构方法,实现工具 U2W:先解开 DAT 测试为多个聚焦测试,再将结构相似测试编织为紧凑的参数化单元测试(PUT),以减少冗余并提升可读性、可维护性和故障定位能力。评估包括:在 49 个开源项目的 42,334 个测试上做定量研究,95.9% 项目存在 DAT,平均影响 8.59% 测试;共重构 3,638 个异味测试,拆解为 31,837 条测试执行逻辑,并将 14,343 条织入 1,713 个 PUT,异味测试可执行代码行平均减少 36.33%。49 名参与者的用户调查偏好重构版本;提交 19 个 PR,16 个被接受。

问题
研究问题是识别并消除测试代码中单个测试方法验证多个逻辑无关行为的 Disjoint Assertion Tangle 异味,并评估其普遍性与自动重构效果。
方法
提出基于程序分析的自动检测与重构技术,并实现工具 U2W,将 DAT 测试拆分为聚焦测试并织入参数化单元测试。
评估
对 49 个开源项目中的 42,334 个测试进行定量研究,并结合 49 人用户调查与 19 个 PR(16 个被接受)验证重构的开发者偏好与可接受性。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9578,
  title = {What’s DAT Smell? Untangling and Weaving the Disjoint Assertion Tangle Test Smell},
  author = {Monil Narang and Hang Du and James A. Jones},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00108}
}