Solving Semantic Searches for Source Code

Kathryn Thomasset Stolee, Sebastian G. Elbaum, Daniel Dobos · 2012

Abstract—Programmers search for code frequently utilizing syntactic queries. The effectiveness of this type of search depends on the ability of a programmer to specify a query that captures how the desired code may have been implemented, and the results often include many irrelevant matches that must be filtered man-ually. More semantic search approaches could address these limi-tations, yet the existing approaches either do not scale or require for the programmer to define complex queries. Instead, our ap-proach to semantic search requires for the programmer to write lightweight, incomplete specifications, such as an example input and expected output of a desired function. Unlike existing ap-proaches to semantic search, we use an SMT solver to identify programs in a repository, encoded as constraints, that match the programmer-provided specification. We instantiate the approach on subsets of the Java string library, Yahoo! Pipes mashup lan-guage, and SQL select statements, and begin to assess its effective-ness and efficiency through evaluations in each domain. I.

Read the paper · More papers on PaperTik