基于深度学习代码相似性的程序修复成分排序与转换
Sorting and Transforming Program Repair Ingredients via Deep Learning Code Similarities
AI总结:
本文提出DeepRepair,利用深度学习代码相似性对修复成分排序与转换,在374个缺陷程序上实验,虽补丁数量无显著提升,但能发现现有冗余修复技术无法找到的补丁。
摘要:
在自动程序修复领域,冗余假设认为大型程序包含其自身修复所需的种子。然而,大多数基于冗余的修复技术并不对修复成分(即用于构造补丁的代码)进行推理。我们旨在通过使用代码相似性来对代码库中的语句进行排序和转换,从而对修复成分进行推理,以生成补丁。我们的方法DeepRepair依赖深度学习来推理代码相似性。代码库中粒度明确的代码片段可以根据它们与可疑元素(即包含可疑语句的代码元素)的相似性进行排序,并且可以通过将作用域外的标识符映射到作用域内的相似标识符来转换语句。我们从软件维护者的角度,针对补丁生成的有效性检验了这些新的搜索策略。我们的对比实验在六个开源Java项目上执行,包括374个有缺陷的程序修订版本,共进行了19,949次试验,累计计算时间达2,616天。DeepRepair使用代码相似性的搜索策略通常比基线方法jGenProg更快地找到可编译的成分,但这种改进既没有在更少的尝试次数内(平均而言)产生测试充分的补丁,也没有比基线方法找到显著更多的补丁。尽管补丁数量在统计上没有显著差异,但DeepRepair补丁与基线补丁的性质存在显著差异。结果表明,我们基于学习的方法能够找到现有基于冗余的修复技术无法找到的补丁。
英文摘要:
In the field of automated program repair, the redundancy assumption claims large programs contain the seeds of their own repair. However, most redundancy-based program repair techniques do not reason about the repair ingredients---the code that is reused to craft a patch. We aim to reason about the repair ingredients by using code similarities to prioritize and transform statements in a codebase for patch generation. Our approach, DeepRepair, relies on deep learning to reason about code similarities. Code fragments at well-defined levels of granularity in a codebase can be sorted according to their similarity to suspicious elements (i.e., code elements that contain suspicious statements) and statements can be transformed by mapping out-of-scope identifiers to similar identifiers in scope. We examined these new search strategies for patch generation with respect to effectiveness from the viewpoint of a software maintainer. Our comparative experiments were executed on six open-source Java projects including 374 buggy program revisions and consisted of 19,949 trials spanning 2,616 days of computation time. DeepRepair's search strategy using code similarities generally found compilable ingredients faster than the baseline, jGenProg, but this improvement neither yielded test-adequate patches in fewer attempts (on average) nor found significantly more patches than the baseline. Although the patch counts were not statistically different, there were notable differences between the nature of DeepRepair patches and baseline patches. The results demonstrate that our learning-based approach finds patches that cannot be found by existing redundancy-based repair techniques.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。