The Remarkable Role of Similarity in Redundancy-based Program Repair
arXiv:1811.05703
Abstract
Recently, there have been original attempts to use the concept of "code similarity" in program repair, suggesting that similarity analysis has an important role in the repair process. However, there is no dedicated work to characterize and quantify the role of similarity in redundancy-based program repair, where the patch is composed from source code taken from somewhere else. This is where our paper makes a major contribution: we perform a deep and systematic analysis of the role of code similarity during the exploration of the repair search space. We define and set up a large-scale experiment based on four code similarity metrics that capture different similarities: character, token, semantic and structure similarity. Overall, we have computed 56 million similarity score over 15 million source code components. We show that with similarity analysis, at least 90% of search space can be ignored to find the correct patch. Code similarity is capable of ranking the correct repair ingredient first in 4 - 33 % of the considered cases.
References in corpus (9)
- Efficient Estimation of Word Representations in Vector Space
- Distributed Representations of Words and Phrases and their Compositionality
- Distributed Representations of Sentences and Documents
- Sorting and Transforming Program Repair Ingredients via Deep Learning Code Similarities
- Identifying Patch Correctness in Test-Based Program Repair
- Learning to Represent Programs with Graphs
- Astor: Exploring the Design Space of Generate-and-Validate Program Repair beyond GenProg
- The CodRep Machine Learning on Source Code Competition
- Revisiting ssFix for Better Program Repair
Cited by in corpus (6)
- A Literature Study of Embeddings on Source Code
- STRATA: Simple, Gradient-Free Attacks for Models of Code
- Combining Code Embedding with Static Analysis for Function-Call Completion
- Interactive Patch Filtering as Debugging Aid
- Impact of Combining Syntactic and Semantic Similarities on Patch Prioritization while using the Insertion Mutation Operators
- A Controlled Experiment of Different Code Representations for Learning-Based Bug Repair