当前位置: X-MOL 学术Empir. Software Eng. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
The effectiveness of context-based change application on automatic program repair
Empirical Software Engineering ( IF 4.1 ) Pub Date : 2019-09-02 , DOI: 10.1007/s10664-019-09770-1
Jindae Kim , Jeongho Kim , Eunseok Lee , Sunghun Kim

An Automatic Program Repair (APR) technique is an implementation of a repair model to fix a given bug by modifying program behavior. Recently, repair models which collect source code and code changes from software history and use such collected resources for patch generation became more popular. Collected resources are used to expand the patch search space and to increase the probability that correct patches for bugs are included in the space. However, it is also revealed that navigation on such expanded patch search space is difficult due to the sparseness of correct patches in the space. In this study, we evaluate the effectiveness of Context-based Change Application (CCA) technique on change selection, fix location selection and change concretization, which are the key aspects of navigating patch search space. CCA collects abstract subtree changes and their AST contexts, and applies them to fix locations only if their contexts are matched. CCA repair model can address both search space expansion and navigation issues, by expanding search space with collected changes while narrowing down search areas in the search space based on contexts. Since CCA applies changes to a fix location only if their contexts are matched, it only needs to consider the same context changes for each fix location. Also, if there is no change with the same context as a fix location, this fix location can be ignored since it means that past patches did not modify such locations. In addition, CCA uses fine-grained changes preserving changed code structures, but normalizing user-defined names. Hence change concretization can be simply done by replacing normalized names with concrete names available in buggy code. We evaluated CCA’s effectiveness with over 54K unique collected changes (221K in total) from about 5K human-written patches. Results show that using contexts, CCA correctly found 90.1% of the changes required for test set patches, while fewer than 5% of the changes were found without contexts. We discovered that collecting more changes is only helpful if it is supported by contexts for effective search space navigation. In addition, CCA repair model found 44-70% of the actual fix locations of Defects4j patches more quickly compared to using SBFL techniques only. We also found that about 48% of the patches can be fully concretized using concrete names from buggy code.

中文翻译:

基于上下文的更改应用程序自动修复的有效性

自动程序修复 (APR) 技术是通过修改程序行为来修复给定错误的修复模型的实现。最近,从软件历史中收集源代码和代码更改并将这些收集到的资源用于补丁生成的修复模型变得越来越流行。收集的资源用于扩展补丁搜索空间,并增加空间中包含针对错误的正确补丁的可能性。然而,也表明由于空间中正确补丁的稀疏性,在这种扩展的补丁搜索空间上导航是困难的。在这项研究中,我们评估了基于上下文的变更应用 (CCA) 技术在变更选择、固定位置选择和变更具体化方面的有效性,这些都是导航补丁搜索空间的关键方面。CCA 收集抽象子树更改及其 AST 上下文,并仅在上下文匹配时将它们应用于修复位置。CCA 修复模型可以解决搜索空间扩展和导航问题,通过使用收集的更改扩展搜索空间,同时根据上下文缩小搜索空间中的搜索区域。由于 CCA 仅在上下文匹配时才将更改应用于修复位置,因此它只需要考虑每个修复位置的相同上下文更改。此外,如果与修复位置相同的上下文没有更改,则可以忽略此修复位置,因为这意味着过去的补丁没有修改这些位置。此外,CCA 使用细粒度更改保留更改的代码结构,但规范化用户定义的名称。因此,更改具体化可以简单地通过用错误代码中可用的具体名称替换规范化名称来完成。我们从大约 5K 个人工编写的补丁中收集了超过 54K 个独特的变化(总共 221K)来评估 CCA 的有效性。结果表明,使用上下文,CCA 正确找到了 90.1% 的测试集补丁所需的更改,而在没有上下文的情况下发现的更改不到 5%。我们发现,只有在上下文支持有效搜索空间导航时,收集更多更改才会有帮助。此外,与仅使用 SBFL 技术相比,CCA 修复模型更快地找到了 44-70% 的 Defects4j 补丁的实际修复位置。我们还发现,大约 48% 的补丁可以使用来自错误代码的具体名称完全具体化。我们从大约 5K 个人工编写的补丁中收集了超过 54K 个独特的变化(总共 221K)来评估 CCA 的有效性。结果表明,使用上下文,CCA 正确找到了 90.1% 的测试集补丁所需的更改,而在没有上下文的情况下发现的更改不到 5%。我们发现,只有在上下文支持有效搜索空间导航时,收集更多更改才会有帮助。此外,与仅使用 SBFL 技术相比,CCA 修复模型更快地找到了 44-70% 的 Defects4j 补丁的实际修复位置。我们还发现,大约 48% 的补丁可以使用来自错误代码的具体名称完全具体化。我们从大约 5K 个人工编写的补丁中收集了超过 54K 个独特的变化(总共 221K)来评估 CCA 的有效性。结果表明,使用上下文,CCA 正确找到了 90.1% 的测试集补丁所需的更改,而在没有上下文的情况下发现的更改不到 5%。我们发现,只有在上下文支持有效搜索空间导航时,收集更多更改才会有帮助。此外,与仅使用 SBFL 技术相比,CCA 修复模型更快地发现了 44-70% 的 Defects4j 补丁的实际修复位置。我们还发现,大约 48% 的补丁可以使用来自错误代码的具体名称完全具体化。测试集补丁所需的更改的 1%,而在没有上下文的情况下发现的更改不到 5%。我们发现,只有在上下文支持有效搜索空间导航时,收集更多更改才会有帮助。此外,与仅使用 SBFL 技术相比,CCA 修复模型更快地找到了 44-70% 的 Defects4j 补丁的实际修复位置。我们还发现,大约 48% 的补丁可以使用来自错误代码的具体名称完全具体化。测试集补丁所需的更改的 1%,而在没有上下文的情况下发现的更改不到 5%。我们发现,只有在上下文支持有效搜索空间导航时,收集更多更改才会有帮助。此外,与仅使用 SBFL 技术相比,CCA 修复模型更快地找到了 44-70% 的 Defects4j 补丁的实际修复位置。我们还发现,大约 48% 的补丁可以使用来自错误代码的具体名称完全具体化。
更新日期:2019-09-02
down
wechat
bug