Publication Type

Conference Proceeding Article

Version

publishedVersion

Publication Date

9-2007

Abstract

Studies show that programs contain much similar code, commonly known as clones. One of the main reasons for introducing clones is programmers' tendency to copy and paste code to quickly duplicate functionality. We commonly believe that clones can make programs difficult to maintain and introduce subtle bugs. Although much research has proposed techniques for detecting and removing clones to improve software maintainability, little has considered how to detect latent bugs introduced by clones. In this paper, we introduce a general notion of context-based inconsistencies among clones and develop an efficient algorithm to detect such inconsistencies for locating bugs. We have implemented our algorithm and evaluated it on large open source projects including the latest versions of the Linux kernel and Eclipse. We have discovered many previously unknown bugs and programming style issues in both projects (with 57 for the Linux kernel and 38 for Eclipse). We have also categorized the bugs and style issues and noticed that they exhibit diverse characteristics and are difficult to detect with any single existing bug detection technique. We believe that our approach complements well these existing techniques.

Keywords

code clone-related bugs, inconsistencies, code clone detection, context-based bug detection

Discipline

Software Engineering

Research Areas

Software and Cyber-Physical Systems

Publication

ESEC-FSE'07: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering: Dubrovnik, Croatia, September 3-7, 2007

First Page

55

Last Page

64

ISBN

9781595938114

Identifier

10.1145/1287624.1287634

Publisher

ACM

City or Country

New York

Additional URL

http://doi.org/10.1145/1287624.1287634

Share

COinS