arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.01181cs.SE
收藏

编码智能体能发现自身的漏洞吗?(它们不能。)

Do Coding Agents Catch Their Own Bugs? (They Don't.)

New York University(纽约大学);Princeton University(普林斯顿大学);Stanford University(斯坦福大学)

Shaswat Patel, Michel Liao, Peter Henderson, He He, Valerie Chen

AI总结:

研究发现编码智能体难以预见自身代码引入的缺陷,推出Foresight-SWE基准测试,评估11个大语言模型的前瞻性解决率仅为6.13%-24.53%,为改进编码模型与工具提供方向。

摘要:

在软件开发中,工程师需要预见并修复代码中未在需求中明确指定的潜在问题,比如从代码变更中预先考虑漏洞或其他缺陷。但当前的基准测试通常不衡量这些前瞻性的后果。我们推出$\textbf{Foresight-SWE}$,这是一个用于衡量编码智能体在软件工程任务中能否预见并解决未明确问题的基准。Foresight-SWE包含212个样本,覆盖4种编程语言和35个流行的开源仓库。每个样本包含两个拉取请求(PR),第二个PR用于解决第一个PR引入的缺陷。为衡量智能体是否具备前瞻性,我们定义$\textbf{前瞻性解决率(FRR)}$为智能体在完全解决原始任务的同时,还能避免后续PR所识别缺陷的实例比例。我们评估了11个大语言模型,发现FRR仅在6.13%至24.53%之间,表明模型在很大程度上未能解决第一个PR变更引入的问题。这引发了关于编码场景中模型的训练与对齐方式,以及应如何改进代码审查工具以实现更安全编码的重要问题。Foresight-SWE推动了这一方向的评估。

英文摘要:

In software development, engineers need to foresee and fix potential problems with their code that are not explicitly specified in requirements---such as pre-emptively considering vulnerabilities or other bugs from a code change. But current benchmarks often do not measure these future-looking consequences. We introduce $\textbf{Foresight-SWE}$, a benchmark for measuring whether coding agents can anticipate and address unstated problems during software engineering tasks. Foresight-SWE consists of 212 samples spanning 4 languages and 35 popular open-source repositories. Each sample contains two pull requests (PRs), the second of which resolves defects the first one introduced. To measure whether agents exhibit foresight, we define the $\textbf{foresight resolve rate (FRR)}$ as the fraction of instances where an agent fully resolves the original task while also avoiding the defect identified by a later PR. We evaluate eleven large language models and find that FRR ranges from only 6.13% to 24.53%, indicating that models largely fail to address problems introduced by the first PR change. This raises important questions about how models are trained and aligned in coding contexts, as well as how code review tools should be improved for more fail-safe coding. Foresight-SWE shifts evaluations in this direction.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑