arrow
Return

Solving the Search for Source Code

delete2014-06-02
delete86
delete
OA
AI
K
Kathryn T. Stolee *
S
Sebastian Elbaum
D
Daniel Dobos
DOI:10.1145/2581377delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Programmers frequently search for source code to reuse using keyword searches. The search effectiveness in facilitating reuse, however, depends on the programmer's ability to specify a query that captures how the desired code may have been implemented. Further, the results often include many irrelevant matches that must be filtered manually. More semantic search approaches could address these limitations, yet existing approaches are either not flexible enough to find approximate matches or require the programmer to define complex specifications as queries. We propose a novel approach to semantic code search that addresses several of these limitations and is designed for queries that can be described using a concrete input/output example. In this approach, programmers write lightweight specifications as inputs and expected output examples. Unlike existing approaches to semantic search, we use an SMT solver to identify programs or program fragments in a repository, which have been automatically transformed into constraints using symbolic analysis, that match the programmer-provided specification. We instantiated and evaluated this approach in subsets of three languages, the Java String library, Yahoo! Pipes mashup language, and SQL select statements, exploring its generality, utility, and trade-offs. The results indicate that this approach is effective at finding relevant code, can be used on its own or to filter results from keyword searches to increase search precision, and is adaptable to find approximate matches and then guide modifications to match the user specifications when exact matches do not already exist. These gains in precision and flexibility come at the cost of performance, for which underlying factors and mitigation strategies are identified.
Keywords:
Verification
Languages
Experimentation
Semantic code search
symbolic analysis
SMT solvers
lightweight specification
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

I
Iowa State University
Scholars:
2.1W
Papers: 1.8W
Citations: 2.5W
University of Nebraska System cover
University of Nebraska System
Scholars:
2.7W
Papers: 2.3W
Citations: 58
Cited Papers

Cited Papers

errShare
errSave
Unusual Photoisomerization Pathway in a Near-Infrared Light Absorbing Enzymerhodopsin
err2022-10-06
err0
PREAI
errMasahiro Sugiura; Kazuki Ishikawa; Kota Katayama; Yuji Sumii; Rei Abe-Yoshizumi; Satoshi P. Tsunoda; Yuji Furutani; Norio Shibata; Leonid S. Brown; Hideki Kandori
errShare
errSave
The ancientBritons: groundwater fauna survived extreme climate change over tens of millions of years acrossNW Europe
err2014-02-20
err0
errOAAI
errCaitríona E. McInerney; Louise Maurice; Anne L. Robertson; Lee R. F. D. Knight; Jörg Arnscheidt; Chris Venditti; James S. G. Dooley; Thomas Mathers; Severine Matthijs; Karin Eriksson; Graham S. Proudlove; Bernd Hänfling
errShare
errSave
errShare
errSave
How Well Do Search Engines Support Code Retrieval on the Web?
err2011-12-01
err75
errOAAI
errSim, Susan Elliott; Umarji, Medha; Ratanotayanon, Sukanya; Lopes, Cristina V.
errShare
errSave
researcher View more