paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Testora: Using Natural Language Intent to Detect Behavioral Regressions

Testora:利用自然语言意图检测行为回归
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 5/10 · 论文将 LLM 用于通过对比代码变更意图与行为差异来检测回归,属于 LLM 辅助软件工程/测试,与“AI→PL”有一定交叉,且具备工业落地和问题驱动特征;但其核心是动态测试与回归检测,不涉及静态分析、形式化验证、浮点或贝叶斯程序分析,因此不是研究方向核心。引用 7 inbox
Michael Pradel
crossref: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 Testora,首个对比代码变更意图与行为差异来检测回归的自动化方法。

代码变更可能引入回归缺陷或非预期行为。传统回归测试生成将所有行为差异都报为潜在回归,无法区分有意与无意变更。本文提出 Testora,首个对比代码变更意图与行为差异来检测回归的自动化方法。给定一个 pull request,Testora 用 LLM 生成执行修改代码的测试,比较原始与修改后代码的行为,并基于 PR 的自然语言信息(标题、描述、提交信息)用 LLM 将行为差异分类为有意或无意,从而以自然语言意图检测回归。在流行 Python 项目 PR 上,发现 19 个回归缺陷和 11 个意外修复;报告的 13 个回归中 11 个确认、9 个已修复;每 PR 检查 12.3 分钟,LLM 成本 $0.003。

问题
传统回归测试生成无法区分有意行为变更与无意回归,会将所有行为差异报告为潜在回归。
方法
Testora 对给定 PR 用 LLM 生成执行修改代码的测试,比较修改前后行为,并利用 PR 的自然语言信息(标题、描述、提交信息)通过 LLM 分类行为差异是否有意。
评估
在复杂流行的 Python 项目 PR 上评估,发现 19 个回归缺陷和 11 个意外修复,13 个报告回归中 11 个被确认、9 个已修复;每 PR 12.3 分钟、LLM 成本 $0.003。
原文摘要(Abstract)

As software is evolving, code changes can introduce regression bugs or affect the behavior in other unintended ways. Traditional regression test generation is impractical for detecting unintended behavioral changes, because it reports all behavioral differences as potential regressions. However, most code changes are intended to change the behavior in some way, e.g., to fix a bug or to add a new feature. This paper presents Testora, the first automated approach that detects regressions by comparing the intentions of a code change against behavioral differences caused by the code change. Given a pull request (PR), Testora queries an LLM to generate tests that exercise the modified code, compares the behavior of the original and modified code, and classifies any behavioral differences as intended or unintended. For the classification, we present an LLM-based technique that leverages the natural language information associated with the PR, such as the title, description, and commit messages – effectively using the natural language intent to detect behavioral regressions. Applying Testora to PRs of complex and popular Python projects, we find 19 regression bugs and 11 PRs that, despite having another intention, coincidentally fix a bug. Out of 13 regressions reported to the developers, 11 have been confirmed and 9 have already been fixed. The costs of using Testora are acceptable for real-world deployment, with 12.3 minutes to check a PR and LLM costs of only $0.003 per PR. We envision our approach to be used before or shortly after a code change gets merged into a code base, providing a way to early on detect regressions that are not caught by traditional approaches.

链接与引用

DOI 原文 · arXiv ·

BibTeX
@inproceedings{paperbot11575,
  title = {Testora: Using Natural Language Intent to Detect Behavioral Regressions},
  author = {Michael Pradel},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3764527}
}