Test smells reduce test suite reliability and complicate maintenance. While many methods detect test smells, few support automated removal, and most rely on static analysis or machine learning. This study evaluates models with relatively small parameter counts - Llama-3.2-3B, Gemma-2-9B, DeepSeek-R1-14B, and Phi-4-14B - for their ability to detect and refactor test smells using agent-based workflows. We assess workflows with one, two, and four agents over 150 instances of 5 common smells from real-world Java projects. Our approach generalizes to Python, Golang, and JavaScript. All models detected nearly all instances, with Phi-4-14B achieving the best refactoring accuracy (pass@5 of 75.3%). Phi-4-14B with four-agents performed within 5% of proprietary LLMs (single-agent). Multi-agent setups outperformed single-agent ones in three of five smell types, though for Assertion Roulette, one agent sufficed. We submitted pull requests with Phi-4-14B-generated code to open-source projects and six were merged.


翻译:测试异味会降低测试套件的可靠性并增加维护复杂性。尽管已有多种方法用于检测测试异味,但鲜有支持自动化移除的方案,且多数依赖于静态分析或机器学习。本研究评估了参数量相对较小的模型——Llama-3.2-3B、Gemma-2-9B、DeepSeek-R1-14B和Phi-4-14B——在基于智能体工作流中检测与重构测试异味的能力。我们通过单智能体、双智能体和四智能体工作流,对来自真实Java项目的5类常见异味共计150个实例进行了评估。该方法可推广至Python、Golang和JavaScript语言。所有模型均能检测出近全部实例,其中Phi-4-14B实现了最佳重构准确率(pass@5达75.3%)。四智能体配置的Phi-4-14B与商用大语言模型(单智能体)的性能差距在5%以内。在五类异味中,多智能体配置在三类上优于单智能体,但对于"断言轮盘"异味,单智能体已足够。我们向开源项目提交了由Phi-4-14B生成的代码拉取请求,其中六项已被合并。

0
下载
关闭预览

相关内容

FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Hierarchical Imitation - Reinforcement Learning
CreateAMind
19+阅读 · 2018年5月25日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Arxiv
15+阅读 · 2020年2月6日
Deep Face Recognition: A Survey
Arxiv
18+阅读 · 2019年2月12日
Deep Reinforcement Learning: An Overview
Arxiv
17+阅读 · 2018年11月26日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Hierarchical Imitation - Reinforcement Learning
CreateAMind
19+阅读 · 2018年5月25日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
相关论文
Arxiv
15+阅读 · 2020年2月6日
Deep Face Recognition: A Survey
Arxiv
18+阅读 · 2019年2月12日
Deep Reinforcement Learning: An Overview
Arxiv
17+阅读 · 2018年11月26日
相关基金
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员