使用故障场景匹配推荐堆栈溢出帖子以修复错误
Recommending Stack Overflow Posts for Fixing Runtime Exceptions using Failure Scenario Matching
摘要:
使用在线Q&A论坛(如Stack Overflow(SO))来指导解决程序错误以及其他开发问题,在现代软件开发实践中很常见。异常(RE)是SO上积极讨论的一类重要的bug。在这项工作中,我们提出了一种技术和原型工具,称为MAESTRO,可以自动推荐一个SO后,是最相关的开发人员的代码中给定的Java RE。MAESTRO将开发人员代码中的异常生成程序场景与SO帖子中讨论的场景进行比较,并返回最接近的匹配帖子。为了有效地提取和比较异常场景,MAESTRO首先使用帖子中的答案代码片段来暗示帖子的问题代码片段中的一个行子集负责异常,然后将这些行与开发人员的代码进行比较,以各自的抽象程序图(APG)表示。APG是一个简化和抽象的衍生抽象语法树,在这项工作中提出的,它允许一个有效的比较体现在高层次的程序结构的功能,同时丢弃许多低层次的语法或语义差异。我们评估MAESTRO的基准测试的Java RE的78个实例中提取的前500名Java项目在GitHub上,并表明,MAESTRO可以返回一个高度相关或有点相关的SO后对应的异常实例在71%的情况下,相比之下,相关的职位返回只有8% - 44%的情况下,由四个竞争对手的工具基于最先进的技术。我们还进行了用户体验研究MAESTRO与10个Java开发人员,其中参与者判断MAESTRO报告高度相关或有点相关的职位在80%的情况下。在某些情况下,该帖子被认为甚至比参与者手动找到的帖子更好。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。