# Do Code Clones Matter?

**Authors:** Elmar Juergens, Florian Deissenboeck, Benjamin Hummel, Stefan Wagner

arXiv: 1701.05472 · 2017-11-15

## TL;DR

This paper investigates the impact of code cloning on program correctness through a large-scale case study, revealing frequent inconsistent changes and faults caused by clones, and introduces a novel clone detection algorithm.

## Contribution

It provides the first large-scale empirical evidence linking code clones to faults and introduces a new open-source clone detection tool for further research.

## Key findings

- Inconsistent changes to clones are very frequent.
- A significant number of faults are induced by clone modifications.
- The proposed clone detection algorithm is effective and publicly available.

## Abstract

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.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1701.05472/full.md

## Figures

7 figures with captions in the complete paper: https://tomesphere.com/paper/1701.05472/full.md

## References

34 references — full list in the complete paper: https://tomesphere.com/paper/1701.05472/full.md

---
Source: https://tomesphere.com/paper/1701.05472