一句话:通过从GitHub挖掘补丁并学习DSL修复策略,自动为静态分析违规合成高质量补丁,无需测试套件。
传统自动程序修复工具依赖测试套件作为修复规约,而测试套件通常不具备规约质量;静态分析报告的违规也难以直接处理。本文提出 Phoenix,将静态分析器作为 oracle,无需测试套件,通过从 GitHub 挖掘并清洗违规与补丁,学习用新型 DSL 表达的可执行修复策略,再实例化到未见违规。作者从 517 个 GitHub 项目获得 5,389 个唯一违规与补丁,交叉验证生成 4,596 个修复,召回率 85%、精确率 54%。在另外 5 个项目上,Phoenix 为未知 bug 生成 94 个正确补丁,其中 19 个已被合并。
Traditional automatic program repair (APR) tools rely on a test-suite as a repair specification. But test suites even when available are not of specification quality, limiting the performance and hence viability of test-suite based repair. On the other hand, static analysis-based bug finding tools are seeing increasing adoption in industry but still face challenges since the reported violations are viewed as not easily actionable. We propose a novel solution that solves both these challenges through a technique for automatically generating high-quality patches for static analysis violations by learning from examples. Our approach uses the static analyzer as an oracle and does not require a test suite. We realize our solution in a system, Phoenix, that implements a fully-automated pipeline that mines and cleans patches for static analysis violations from the wild, learns generalized executable repair strategies as programs in a novel Domain Specific Language (DSL), and then instantiates concrete repairs from them on new unseen violations. Using Phoenix we mine a corpus of 5,389 unique violations and patches from 517 Github projects. In a cross-validation study on this corpus Phoenix successfully produced 4,596 bug-fixes, with a recall of 85% and a precision of 54%. When applied to the latest revisions of a further5 Github projects, Phoenix produced 94 correct patches to previously unknown bugs, 19 of which have already been accepted and merged by the development teams. To the best of our knowledge this constitutes, by far the largest application of any automatic patch generation technology to large-scale real-world systems