paperbot · PL 论文追踪

全部论文 待读 收藏

P2 When Testing Meets Refactoring

当测试遇上重构
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 3/10 · 论文聚焦测试代码重构的模式目录、检测工具与大规模基准数据集,属于软件工程/静态分析在测试重构方向的应用,但与用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析均无直接关联。仅在“构建缺乏基准的重要场景数据集”和静态分析工具工程实现上有间接交集,因此匹配度较低。引用 0 inbox
Victor Guerra Veloso
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:构建统一的测试重构模式目录与检测工具,并在 170 万个 Java 项目上生成真值基准数据集。

测试代码同样会腐化,需要重构维护,但测试特有的代码异味虽有理论记载,针对测试重构的自动化检测与推荐仍处起步阶段,知识分散、工具不足。本文采用混合方法(仓库挖掘、开发者调查与 StackOverflow 讨论分析)整理出统一的测试重构模式目录,并据此扩展 RefactoringMiner 加入测试感知检测,提出 PatternTracker 在版本历史中追踪测试模式演化。基于该基础设施分析 170 万个 Java 项目,生成高置信度的测试重构真值数据集,验证模式在开源项目中的普遍性,并为评估未来自动推荐系统(含大语言模型驱动方法)建立基准。

问题
测试代码自身也会腐化,然而测试特有的代码异味虽有理论记载,测试重构的自动化检测与推荐仍不成熟,知识碎片化且缺乏合适工具。
方法
以仓库挖掘、开发者调查和 StackOverflow 讨论分析的混合方法构建统一的测试重构模式目录,并扩展 RefactoringMiner 增加测试感知检测能力,同时开发 PatternTracker 追踪测试模式在版本历史中的演化。
评估
在 170 万个 Java 项目上运行上述基础设施,生成高置信度的测试重构真值数据集,验证这些模式在开源项目中的普遍性,并作为评估未来自动推荐系统的基准。
原文摘要(Abstract)

Automated software testing is critical for modern software development, yet test code itself requires maintenance and refactoring to prevent decay. While theoretical test-specific code smells are well-documented, the practical automation of test refactoring—both detection and recommendation—remains incipient, leading to fragmented knowledge and inadequate tooling. This paper bridges this gap by presenting a unified catalogue of test refactoring patterns derived from a mixed-method approach involving repository mining, developer surveys, and analysis of StackOverflow discussions. To operationalize this catalogue, we extend RefactoringMiner with test-aware detection capabilities and introduce PatternTracker, a tool for identifying and tracking the evolution of test patterns across version history. Leveraging this infrastructure, we analyzed 1.7 million Java projects to generate a high-confidence ground-truth dataset of test refactorings. Our results validate the prevalence of these patterns in open-source projects and establish a rigorous benchmark for evaluating future automated recommendation systems, including those driven by Large Language Models.

链接与引用

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

BibTeX
@inproceedings{Veloso26,
  title = {When Testing Meets Refactoring},
  author = {Victor Guerra Veloso},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3804874}
}