论文标题

推荐使用故障场景匹配的堆栈溢出帖子用于修复运行时异常

Recommending Stack Overflow Posts for Fixing Runtime Exceptions using Failure Scenario Matching

论文作者

Mahajan, Sonal, Abolhassani, Negarsadat, Prasad, Mukul R.

论文摘要

在现代软件开发实践中,使用在线问答论坛(例如堆栈溢出(SO))以解决程序错误,除其他开发问题外,这是司空见惯的。运行时异常(RE)是这样一个重要的错误类,因此在So上进行了积极讨论。在这项工作中,我们提出了一种名为Maestro的技术和原型工具,该工具可以自动推荐与开发人员代码中给定的Java Re最相关的SO帖子。 Maestro将开发人员代码中异常的程序方案与SO帖子中讨论的情况进行了比较,并以最接近的匹配返回了该帖子。为了有效地提取和比较例子,Maestro首先在帖子中使用答案代码段,以将帖子的问题代码段中的一部分线牵涉到负责例外的一部分,然后根据其各自的抽象程序图(APG)表示这些线条与开发人员的代码进行比较。 APG是本工作中提出的抽象语法树的简化且抽象的衍生物,可以有效比较高级程序结构中体现的功能,同时丢弃许多低级语法或语义差异。我们根据Github上的前500个Java项目提取的78个Java Res实例的基准评估大师,并表明Maestro可以返回与仅在8%-44%的Instances contentances contecters Instances files the Competitions Instances中相比,与该案件相关的相关帖子的相关帖子中的71%的案件中的异常实例相对应的,这是由8%-44%的州立竞争者工具基于州的工具。我们还与10位Java开发人员对Maestro进行了一项用户体验研究,参与者在80%的实例中判断Maestro报告了高度相关或有些相关的职位。在某些情况下,该帖子被认为比参与者手动发现的帖子还要好。

Using online Q&A forums, such as Stack Overflow (SO), for guidance to resolve program bugs, among other development issues, is commonplace in modern software development practice. Runtime exceptions (RE) is one such important class of bugs that is actively discussed on SO. In this work we present a technique and prototype tool called MAESTRO that can automatically recommend an SO post that is most relevant to a given Java RE in a developer's code. MAESTRO compares the exception-generating program scenario in the developer's code with that discussed in an SO post and returns the post with the closest match. To extract and compare the exception scenario effectively, MAESTRO first uses the answer code snippets in a post to implicate a subset of lines in the post's question code snippet as responsible for the exception and then compares these lines with the developer's code in terms of their respective Abstract Program Graph (APG) representations. The APG is a simplified and abstracted derivative of an abstract syntax tree, proposed in this work, that allows an effective comparison of the functionality embodied in the high-level program structure, while discarding many of the low-level syntactic or semantic differences. We evaluate MAESTRO on a benchmark of 78 instances of Java REs extracted from the top 500 Java projects on GitHub and show that MAESTRO can return either a highly relevant or somewhat relevant SO post corresponding to the exception instance in 71% of the cases, compared to relevant posts returned in only 8% - 44% instances, by four competitor tools based on state-of-the-art techniques. We also conduct a user experience study of MAESTRO with 10 Java developers, where the participants judge MAESTRO reporting a highly relevant or somewhat relevant post in 80% of the instances. In some cases the post is judged to be even better than the one manually found by the participant.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源