Abstract: Reusability is one of the assets of software. The software engineering helps for reusability. It helps in reducing the cost and time in development of software which are one of main influencing factors in software development life cycle. It increases the productivity and results by the programmer. Even it good still scale and approximate matches then complex specification is an open issue. We propose a novel approach to semantic search that addresses some of these limitations and is designed for queries that can be described using an example. In this approach, programmers write lightweight specifications as inputs and expected output examples for the behavior of desired code. Using these specifications, an SMT solver identifies source code from a repository that matches the specifications. This research contributes the first work toward using SMT solvers to search for existing source code. In this, we motivate the study of code search and the utility of a more semantic approach to code search. We introduce and illustrate the generality of our approach using subsets of three languages, Java, Yahoo! Pipes, and SQL. Our approach is implemented in a tool, Satsy, for Yahoo! Pipes and Java. Finally, we show that this approach is adaptable to finding approximate matches when exact matches do not exist, and that programmers are capable of composing input/output queries with reasonable speed and accuracy. These results are promising and lead to several open research questions that we are only beginning to explore.

Keywords: Novel Approach, Semantic Search, SMT Solver, SNIFF, Java, Yahoo! Pipes, and SQL.