诸如计算树逻辑(Computation Tree Logic,CTL)之类的时序逻辑已被广泛用作表达丰富行为规范的表达形式体系。CTL能够表达可达性、终止性、不变性和响应性等难以测试的性质。本文提出了一种由CTL性质引导的无限状态程序自动修复机制。我们生成的补丁避免了测试用例集引导的修复中出现的过拟合问题——这类问题中修复后的代码可能无法通过给定测试用例集之外的测试。为实现这一目标,我们提出了一种基于Datalog的修复框架,Datalog是一种广泛用于程序分析的领域特定语言,它通过分层否定可直接支持CTL的嵌套不动点语义。具体而言,我们的框架将程序和CTL性质编码为Datalog事实与规则,并通过修改事实以满足分析规则来执行修复。此前的研究以Datalog符号执行(Symbolic Execution of Datalog,SEDL)的形式提出了一种基于Datalog分析的通用修复机制。然而,SEDL仅支持正Datalog,不足以表达CTL性质。因此,我们对SEDL进行了扩展,使其适用于分层Datalog。此外,活性性质的违反涉及无限计算,我们通过一种新颖的循环摘要方法来处理该问题。我们的方法在小规模基准上实现了56.6%的分析准确率,在真实世界基准上实现了88.5%的分析准确率,优于27.7%和76.9%的最佳基线性能。我们的方法修复了所有检测到的错误,这是现有工具无法实现的。
英文摘要:
Temporal logics like Computation Tree Logic (CTL) have been widely used as expressive formalisms to capture rich behavioral specifications. CTL can express properties such as reachability, termination, invariants and responsiveness, which are difficult to test. This paper suggests a mechanism for the automated repair of infinite-state programs guided by CTL properties. Our produced patches avoid the overfitting issue that occurs in test-suite-guided repair, where the repaired code may not pass tests outside the given test suite. To realize this vision, we propose a repair framework based on Datalog, a widely used domain-specific language for program analysis, which readily supports nested fixed-point semantics of CTL via stratified negation. Specifically, our framework encodes the program and CTL properties into Datalog facts and rules and performs the repair by modifying the facts to pass the analysis rules. Previous research proposed a generic repair mechanism for Datalog-based analysis in the form of Symbolic Execution of Datalog (SEDL). However, SEDL only supports positive Datalog, which is insufficient for expressing CTL properties. Thus, we extended SEDL to make it applicable to stratified Datalog. Moreover, liveness property violations involve infinite computations, which we handle via a novel loop summarization. Our approach achieves analysis accuracy of 56.6% on a small-scale benchmark and 88.5% on a real-world benchmark, outperforming the best baseline performances of 27.7% and 76.9%. Our approach repairs all detected bugs, which is not achieved by existing tools.
MORepair: Teaching LLMs to Repair Code via Multi-Objective Fine-tuning
School of Information Science and Engineering, Yanshan University(燕山大学信息科学与工程学院);School of Computing and Information Systems, University of Melbourne(墨尔本大学计算与信息系);School of Big Data and Software Engineering, Chongqing University(重庆大学大数据与软件学院);SnT, University of Luxembourg(卢森堡大学技术与创新研究所);School of Computer Science, Carnegie Mellon University(卡内基梅隆大学计算机科学学院)
Multi-Location Program Repair Strategies Learned from Past Successful Experience
自动程序修复(Automated program repair,APR)在减少软件维护工作量和时间消耗方面具有巨大的潜力,近年来成为软件工程的研究热点,提出了许多方法。多位置程序修复由于其逻辑和结构的复杂性一直是该领域的一个挑战。虽然一些方法并不声称具有解决多位置错误的功能,但它们在实践中为这些缺陷生成正确的补丁。在本文中,我们首先对Defects4J中的多位置错误进行了观察,并将其分为两类(即,相似的和相关的多位置错误)基于其补丁中的修复动作。然后,我们总结了当前工具修复Defects4J中多位置错误的情况。我们分析了当前工具生成的22个补丁,并提出了两个可行的策略来修复多位置错误,通过两个详细的案例研究来说明它们。最后,通过修复两个从未修复过的漏洞,验证了该方法的可行性。通过借鉴以往的成功经验,指出了多位置程序修复的可能途径。
Metamodel-Guided Model Generation with Layered Constraints
University of Science and Technology of China(中国科学技术大学);Hefei Institutes of Physical Science, Chinese Academy of Sciences(中国科学院合肥物质科学研究院);Anhui University(安徽大学)
K. N. Toosi University of Technology(肯恩·托基大学);Ferdowsi University of Mashhad(马什哈德费尔多西大学);Simon Fraser University(西蒙菲莎大学);Amirkabir University of Technology(阿米尔卡比尔理工大学)
Repeton: Structured Bug Repair with ReAct-Guided Patch-and-Test Cycles
Uppsala University Sweden;Hanoi University of Science \& Technology Vietnam;Knovel Engineering Lab Singapore;The University of Alabama at Birmingham USA;Uppsala University;Hanoi University of Science \& Technology;Knovel Engineering Lab;The University of Alabama at Birmingham;Institute for Clarity in Documentation Dublin Ohio USA;Inria Paris-Rocquencourt Rocquencourt France;Rajiv Gandhi University Doimukh Arunachal Pradesh India;Tsinghua University Haidian Qu Beijing Shi China;Palmer Research Laboratories San Antonio Texas USA;Institute for Clarity in Documentation;Inria Paris-Rocquencourt;Rajiv Gandhi University;Tsinghua University;Palmer Research Laboratories
本文提出开源框架 Repeton,用 ReAct 引导的结构化补丁与测试循环替代整体修复生成,在 SWE-bench Lite 上提升补丁有效性与可解释性。