Title
The plastic surgery hypothesis
Abstract
Recent work on genetic-programming-based approaches to automatic program patching have relied on the insight that the content of new code can often be assembled out of fragments of code that already exist in the code base. This insight has been dubbed the plastic surgery hypothesis; successful, well-known automatic repair tools such as GenProg rest on this hypothesis, but it has never been validated. We formalize and validate the plastic surgery hypothesis and empirically measure the extent to which raw material for changes actually already exists in projects. In this paper, we mount a large-scale study of several large Java projects, and examine a history of 15,723 commits to determine the extent to which these commits are graftable, i.e., can be reconstituted from existing code, and find an encouraging degree of graftability, surprisingly independent of commit size and type of commit. For example, we find that changes are 43% graftable from the exact version of the software being changed. With a view to investigating the difficulty of finding these grafts, we study the abundance of such grafts in three possible sources: the immediately previous version, prior history, and other projects. We also examine the contiguity or chunking of these grafts, and the degree to which grafts can be found in the same file. Our results are quite promising and suggest an optimistic future for automatic program patching methods that search for raw material in already extant code in the project being patched.
Year
DOI
Venue
2014
10.1145/2635868.2635898
SIGSOFT FSE
Keywords
Field
DocType
software graftability,mining software repositories,automated program repair,reusable software,code reuse,empirical software engineering
Contiguity,Software engineering,Computer science,Commit,Software,Chunking (psychology),Extant taxon,Code reuse,Empirical process (process control model),Java
Conference
Citations 
PageRank 
References 
71
1.56
33
Authors
5
Name
Order
Citations
PageRank
Earl T. Barr146815.46
Yuriy Brun2221691.89
Premkumar T. Devanbu3711.56
Mark Harman410264389.82
Federica Sarro563236.74