论文

ORION:用结构化 Oracle 在 PR 阶段检测代码回归

Behavioral Regression Detection for Pull Requests via Structured Oracles

精选理由

这篇论文做了个叫 ORION 的工具,能在 PR 合并前自动找出代码回归,F1 超过 Codex 和 Claude Code,还能接进 CI/CD,做开发的朋友可以看看。

论文提出 ORION,一个面向 Pull Request 的回归检测框架,先通过 AST 影响分析定位受影响函数,再从 PR 意图和代码变更合成结构化行为 Oracle。基于 Oracle 生成可执行测试,并在变更前后代码上差分运行。作者构建了首个 Python PR 回归基准 RegBench-Py,包含 154 个真实 PR。ORION 使用 DeepSeek-Chat-V3.2 达到 F1 0.6125,使用 Claude-4.5-haiku 达到 0.5578,超过 Testora、Codex 和 Claude Code 等基线。在 1,459 个已合并 PR 上找到 9 个可复现回归候选,其中 8 个获维护者确认,单个 PR 耗时约 15 分钟。

原文 · arXiv: DeepSeek

Behavioral Regression Detection for Pull Requests via Structured Oracles

Software regressions are unintended behavioral changes introduced by code modifications and are hard to detect at pull-request (PR) level. Existing methods rely on incomplete tests or directly analyze PRs via LLMs, lacking structured behavioral reasoning and explicit oracles. We present ORION, a staged framework for PR-level regression detection. ORION extracts PR intent and identifies impacted functions via AST-based impact analysis, then synthesizes function-level structured behavioral oracles encoding preserved/changed behaviors, setup constraints and control-flow hints from PR intent, static risk signals and code changes. Guided by these oracles, ORION generates executable tests, conducts oracle-coverage-guided augmentation and static repair, and differentially runs tests on pre- and post-change code. It classifies PRs with deterministic rules and constrained LLM reasoning. We build RegBench-Py, the first Python PR regression benchmark with 154 verified real-world PRs. ORION achieves F1-scores of 0.6125 (DeepSeek-Chat-V3.2) and 0.5578 (Claude-4.5-haiku), outperforming baselines including Testora, Codex and Claude Code. Compared with PatchGuru, ORION supports broader multi-function PRs while remaining competitive on single-function cases. On 1,459 merged PRs, ORION finds 9 reproducible regression candidates, 8 confirmed by maintainers. It takes ~15 minutes per PR, showing practicality for CI/CD screening.