arrow
Return

DiffSearch: A Scalable and Precise Search Engine for Code Changes

delete2023-04-01
delete3
delete
OA
AI
L
Luca Di Grazia *
P
Paul Bredl
M
Michael Pradel
DOI:10.1109/TSE.2022.3218859delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
The source code of successful projects is evolving all the time, resulting in hundreds of thousands of code changes stored in source code repositories. This wealth of data can be useful, e.g., to find changes similar to a planned code change or examples of recurring code improvements. This paper presents DiffSearch, a search engine that, given a query that describes a code change, returns a set of changes that match the query. The approach is enabled by three key contributions. First, we present a query language that extends the underlying programming language with wildcards and placeholders, providing an intuitive way of formulating queries that is easy to adapt to different programming languages. Second, to ensure scalability, the approach indexes code changes in a one-time preprocessing step, mapping them into a feature space, and then performs an efficient search in the feature space for each query. Third, to guarantee precision, i.e., that any returned code change indeed matches the given query, we present a tree-based matching algorithm that checks whether a query can be expanded to a concrete code change. We present implementations for Java, JavaScript, and Python, and show that the approach responds within seconds to queries across one million code changes, has a recall of 80.7% for Java, 89.6% for Python, and 90.4% for JavaScript, enables users to find relevant code changes more effectively than a regular expression-based search and GitHub's search feature, and is helpful for gathering a large-scale dataset of real-world bug fixes.
Keywords:
Codes
Database languages
Search problems
Java
Python
Indexing
Feature extraction
Software engineering
program analysis
software maintenance

Journal

IEEE Transactions on Software Engineering cover
IEEE Transactions on Software Engineering
IF:
5.6
Papers:
2.9K
Citations:
1.1W

Organization

U
University of Stuttgart
Scholars:
1.1W
Papers: 9.4K
Citations: 1.3W
Cited Papers

Cited Papers

errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
A Socially Responsible Islamic Finance
err
IF0
err2017-01-01
err0
PREAI
errUmar F. Moghul
errShare
errSave
Lys63/Met1-hybrid ubiquitin chains are commonly formed during the activation of innate immune signalling
err2016-06-01
err0
errOAAI
errChristoph H. Emmerich; Siddharth Bakshi; Ian R. Kelsall; Juanma Ortiz-Guerrero; Natalia Shpiro; Philip Cohen
errShare
errSave
Neuroscience research in Africa: Current status
err2016-06-01
err0
errOAAI
errFoad Abd-Allah; Najib Kissani; Anthony William; Mohammed Ibrahim Oraby; Ramez Reda Moustafa; Ehab Shaker; Mohamed Soliman El-Tamawy; Raad Shakir
errShare
errSave
Best Management Practices and Nutrient Reduction: An Integrated Economic-Hydrologic Model of the Western Lake Erie Basin
err2020-12-18
err0
errOAAI
errHongxing Liu; Wendong Zhang; Elena Irwin; Jeffrey Kast; Noel Aloysius; Jay Martin; Margaret Kalcic
errShare
errSave
Continental smokers couple mantle degassing and distinctive microbiology within continents
err2016-02-01
err0
errOAAI
errLaura J. Crossey; Karl E. Karlstrom; Brandon Schmandt; Ryan R. Crow; Daniel R. Colman; Brandi Cron; Cristina D. Takacs-Vesbach; Clifford N. Dahm; Diana E. Northup; David R. Hilton; Jason W. Ricketts; Anthony R. Lowry
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
Enzymatic analysis of total- and HDL-cholesterol: Comparison with the standardized Liebermann-Burchard method used by the lipid research clinics program
err1988-06-01
err0
errOAAI
errPaul S. Bachorik; Donna G. Virgil; Carol Derby; David Widman; Robert McMahon; Robinson P. Fulwood; Trena Ezzati
errShare
errSave
researcher View more