跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 软件工程

arXiv:2604.03135 (cs)
[提交于 2026年4月3日]

标题:AI-Assisted Unit Test Writing and Test-Driven Code Refactoring: A Case Study

作者:Ema Smolic, Mario Brcic, Luka Hobor, Mihael Kovac
查看论文《AI-Assisted Unit Test Writing and Test-Driven Code Refactoring: A Case Study》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Many software systems originate as prototypes or minimum viable products (MVPs), developed with an emphasis on delivery speed and responsiveness to changing requirements rather than long-term code maintainability. While effective for rapid delivery, this approach can result in codebases that are difficult to modify, presenting a significant opportunity cost in the era of AI-assisted or even AI-led programming. In this paper, we present a case study of using coding models for automated unit test generation and subsequent safe refactoring, with proposed code changes validated by passing tests. The study examines best practices for iteratively generating tests to capture existing system behavior, followed by model-assisted refactoring under developer supervision. We describe how this workflow constrained refactoring changes, the errors and limitations observed in both phases, the efficiency gains achieved, when manual intervention was necessary, and how we addressed the weak value misalignment we observed in models. Using this approach, we generated nearly 16,000 lines of reliable unit tests in hours rather than weeks, achieved up to 78\% branch coverage in critical modules, and significantly reduced regression risk during large-scale refactoring. These results illustrate software engineering's shift toward an empirical science, emphasizing data collection and constraining mechanisms that support fast, safe iteration.
评论: 6 pages, 3 figures, 2 tables
主题: 软件工程 (cs.SE); 人工智能 (cs.AI)
引用方式: arXiv:2604.03135 [cs.SE]
  (或者 arXiv:2604.03135v1 [cs.SE] 对于此版本)
  https://doi.org/10.48550/arXiv.2604.03135

提交历史

来自:Luka Hobor
[v1] 2026年4月3日 星期五 15:54:43 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.SE
< 上一篇   |   下一篇 >
最新 | 近期 | 2026-04
切换浏览方式为:
cs
cs.AI

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站