paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Test Smell Refactoring with Agentic LLMs: An Empirical Study of Gemini-2.5-Pro

使用智能体式 LLM 进行测试坏味重构:Gemini-2.5-Pro 的实证研究
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文用 Agentic LLM 做测试坏味检测与重构,属于 LLM 辅助软件工程/代码维护,与用户核心的静态分析、形式化验证、浮点程序分析及贝叶斯程序分析交叉较少;其目标更偏评估 LLM/Agent 能力,而非将静态分析用于 Agentic 程序或改进静态分析。引用 0 inbox
Rian Ismael Elias de Melo
crossref: 2026-09-12

AI 速览

一句话:实证评估 Gemini-2.5-Pro 以单/多智能体工作流检测并重构五类测试坏味,单智能体正确率达 75%,多智能体收益有限。

测试坏味是测试代码中反复出现的设计症状,可能影响可维护性与可读性,但现有多数方法只做检测、鲜有自动化移除。本文评估 Gemini-2.5-Pro 在检测与重构五类常见测试坏味上的表现,在 200 个 JUnit 5 测试上比较单智能体、双智能体与四智能体工作流。在单智能体 pass@1 设置下,模型正确检测并重构了 75%(150/200)的用例;多智能体工作流将短测试的检测率提升至 83%,但重构收益边际且成本更高。作者还对 50 名开发者开展调研,将原始测试片段与 Phi-4-14B 生成的重构版本并排展示,约 66% 的对比中开发者更偏好重构版本。

问题
测试坏味的自动检测已有较多工作,但其自动化移除(重构)仍缺乏系统评估,尤其不清楚基于 LLM 的智能体工作流在此任务上的效果、收益与成本。
方法
在 200 个 JUnit 5 测试上,使用 Gemini-2.5-Pro 分别以单智能体、双智能体和四智能体工作流对五类常见测试坏味进行检测与重构;并辅以 50 名开发者的用户调研,将原始片段与 Phi-4-14B 生成的重构版本进行对比。
评估
单智能体 pass@1 正确检测并重构 75%(150/200)用例;多智能体将短测试检测率提升到 83%,但重构增益有限且成本更高;开发者调研中约 66% 的对比偏好重构版本。
原文摘要(Abstract)

Test smells are recurring design symptoms that may indicate potential issues in test maintenance and readability, rather than immediate functional failures. Although many approaches detect these issues, few automate their removal. This study evaluates how Gemini-2.5-Pro performs in detecting and refactoring five common test smells using one-, two-, and four-agent workflows across 200 JUnit 5 tests. Under a single-agent pass@1 setting, Gemini-2.5-Pro correctly detected and refactored 75% (150/200) of cases. While multi-agent workflows improved short-test detection to 83%, they yielded marginal refactoring gains and higher costs. We also conducted a complementary survey with 50 developers, presenting each original test snippet alongside a Phi-4-14B-generated refactoring; the refactored version was preferred in about 66% of the comparisons.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11864,
  title = {Test Smell Refactoring with Agentic LLMs: An Empirical Study of Gemini-2.5-Pro},
  author = {Rian Ismael Elias de Melo},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3774748.3787753}
}