arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1701.05472cs.SE
收藏

代码克隆重要吗?

Do Code Clones Matter?

Elmar Juergens, Florian Deissenboeck, Benjamin Hummel, Stefan Wagner

摘要:

代码克隆不仅被认为会增加维护成本,而且还被认为容易出现缺陷,因为对代码副本的不一致更改可能导致意外行为。因此,重复代码的识别,克隆检测,近年来一直是一个非常活跃的研究领域。然而,到目前为止,还没有对代码克隆对程序正确性的后果进行实质性的调查。为了弥补这一缺陷,本文提出了一个大规模的案例研究,以找出不一致的变化克隆代码可以表明故障的结果。对于所分析的商业和开源系统,我们不仅发现克隆的不一致更改非常频繁,而且还确定了由此类更改引起的大量错误。在案例研究中使用的克隆检测工具实现了一种新的算法,用于检测不一致的克隆。它是开源的,使其他研究人员能够使用它作为进一步调查的基础。

英文摘要:

Code cloning is not only assumed to inflate maintenance costs but also considered defect-prone as inconsistent changes to code duplicates can lead to unexpected behavior. Consequently, the identification of duplicated code, clone detection, has been a very active area of research in recent years. Up to now, however, no substantial investigation of the consequences of code cloning on program correctness has been carried out. To remedy this shortcoming, this paper presents the results of a large-scale case study that was undertaken to find out if inconsistent changes to cloned code can indicate faults. For the analyzed commercial and open source systems we not only found that inconsistent changes to clones are very frequent but also identified a significant number of faults induced by such changes. The clone detection tool used in the case study implements a novel algorithm for the detection of inconsistent clones. It is available as open source to enable other researchers to use it as basis for further investigations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑