Research in automatic program repair has shown that real bugs can be automatically fixed. However, there are several challenges involved in such a task that are not yet fully addressed. As an example, consider that a test-suite-based repair tool performs a change in a program to fix a bug spotted by a failing test case, but then the same or another test case fails. This could mean that the change is a partial fix for the bug or that another bug was manifested. However, the repair tool discards the change and possibly performs other repair attempts. One might wonder if the applied change should be also applied in other locations in the program so that the bug is fully fixed. In this paper, we are interested in investigating the extent of bug fix changes being cloned by developers within patches. Our goal is to investigate the need of multi-location repair by using identical or similar changes in identical or similar contexts. To do so, we analyzed 3,049 multi-hunk patches from the ManySStuBs4J dataset, which is a large dataset of single statement bug fix changes. We found out that 68% of the multi-hunk patches contain at least one change clone group. Moreover, most of these patches (70%) are strictly-cloned ones, which are patches fully composed of changes belonging to one single change clone group. Finally, most of the strictly-cloned patches (89%) contain change clones with identical changes, independently of their contexts. We conclude that automated solutions for creating patches composed of identical or similar changes can be useful for fixing bugs.
翻译:自动程序修理的研究显示, 真正的错误可以自动固定 。 但是, 在这种任务中, 存在一些尚未完全解决的难题 。 例如, 考虑一个基于测试的替代修理工具对程序进行修改, 以修补被失败测试案例发现的错误, 但是同样或另一个测试案例失败。 这可能意味着该修改是对错误的局部修正, 或者显示另一个错误 。 但是, 修复工具抛弃了更改, 并可能进行其他修复尝试 。 人们可能会怀疑, 应用的更改是否也应在程序的其他地点应用, 这样错误就可以完全固定 。 在本文中, 我们感兴趣的是调查错误修正的程度。 我们的目标是通过在相同或类似情况下使用相同或类似的更改来调查多地点修理的需要 。 为此, 我们分析了来自 ManSStuBs4J 数据集的3, 049 多块补丁补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补补。。