一句话:提出 ObjSim,基于对象相似度自动优先排序 APR 补丁,将更可能真实的修复排在前列。
基于测试用例的自动程序修复(APR)常生成通过全部测试却未真正修复缺陷的过拟合补丁,用户需人工甄别,阻碍了 APR 的实际应用。ObjSim 是一个面向 JVM 语言的全自动、轻量级补丁优先级排序工具,其核心思想是在被修复方法的退出点比较修补前后的系统状态:若补丁在通过测试上使状态更接近原始未修补版本,而在失败测试上使状态更不接近,则优先排序。作者用 PraPR 为 Defects4J v1.4.0 中可修复缺陷生成的补丁进行实验,结果表明 ObjSim 在 top-1 位置优先排序出更多真实修复,提升 16.67%。
In the context of test case based automatic program repair (APR), patches that pass all the test cases but fail to fix the bug are called overfitted patches. Currently, patches generated by APR tools get inspected manually by the users to find and adopt genuine fixes. Being a laborious activity hindering widespread adoption of APR, automatic identification of overfitted patches has lately been the topic of active research. This paper presents engineering details of ObjSim: a fully automatic, lightweight similarity-based patch prioritization tool for JVM-based languages. The tool works by comparing the system state at the exit point(s) of patched method before and after patching and prioritizing patches that result in state that is more similar to that of original, unpatched version on passing tests while less similar on failing ones. Our experiments with patches generated by the recent APR tool PraPR for fixable bugs from Defects4J v1.4.0 show that ObjSim prioritizes 16.67% more genuine fixes in top-1 place. A demo video of the tool is located at https://bit.ly/2K8gnYV.