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

利用堆栈溢出贴子提供实时的的故障修复帮助

Providing Real-time Assistance for Repairing Runtime Exceptions using Stack Overflow Posts

Sonal Mahajan, Mukul R. Prasad

摘要:

漏洞(RE)是代码开发过程中经常出现的一类重要的bug。传统的自动程序修复(APR)工具在这种“开发中”用例中的使用有限,因为它们需要一个测试套件作为修补Oracle。因此,开发人员通常倾向于手动解决他们在开发中的RE,通常通过参考技术论坛,如Stack Overflow(SO)。为了自动化这个手动过程,我们扩展了我们以前的工作,MAESTRO,为开发人员提供实时的【形】帮助,通过推荐一个相关的补丁建议SO帖子,并从这个帖子合成一个修复补丁来修复开发人员代码中的RE,来修复Java RE。MAESTRO利用了一个半自动地从SO帖子中挖掘的异常异常模式(REP)库,通过一个相对便宜的一次性增量过程。REP是触发给定RE的语句的抽象序列。REP用于索引SO帖子,检索与开发人员代码展示的RE实例最相关的帖子,然后调解从SO帖子中提取具体修复的过程,抽象出特定于帖子的细节,并将修复具体化到开发人员的错误代码。我们评估MAESTRO上公布的RE基准组成的78个实例。MAESTRO能够在27%的病例中在顶部位置生成正确的修复补片,在40%的病例中在前3位内生成正确的修复补片,并且在81%的病例中总体返回有用的伪影。此外,使用REP证明有助于MAESTRO的性能的各个方面,从排名和搜索SO职位合成补丁从一个给定的职位。特别是,45%的正确补丁生成的MAESTRO不能产生的基线技术不使用REP,即使提供了MAESTRO的SO后排名。MAESTRO也很快,平均需要大约1秒才能产生输出。

英文摘要:

Runtime Exceptions (REs) are an important class of bugs that occur frequently during code development. Traditional Automatic Program Repair (APR) tools are of limited use in this "in-development" use case, since they require a test-suite to be available as a patching oracle. Thus, developers typically tend to manually resolve their in-development REs, often by referring to technical forums, such as Stack Overflow (SO). To automate this manual process we extend our previous work, MAESTRO, to provide real-time assistance to developers for repairing Java REs by recommending a relevant patch-suggesting SO post and synthesizing a repair patch from this post to fix the RE in the developer's code. MAESTRO exploits a library of Runtime Exception Patterns (REPs) semi-automatically mined from SO posts, through a relatively inexpensive, one-time, incremental process. An REP is an abstracted sequence of statements that triggers a given RE. REPs are used to index SO posts, retrieve a post most relevant to the RE instance exhibited by a developer's code and then mediate the process of extracting a concrete repair from the SO post, abstracting out post-specific details, and concretizing the repair to the developer's buggy code. We evaluate MAESTRO on a published RE benchmark comprised of 78 instances. MAESTRO is able to generate a correct repair patch at the top position in 27% of the cases, within the top-3 in 40% of the cases and overall return a useful artifact in 81% of the cases. Further, the use of REPs proves instrumental to all aspects of MAESTRO's performance, from ranking and searching of SO posts to synthesizing patches from a given post. In particular, 45% of correct patches generated by MAESTRO could not be produced by a baseline technique not using REPs, even when provided with MAESTRO's SO-post ranking. MAESTRO is also fast, needing around 1 second, on average, to generate its output.

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

↑