arrow
Return

Enhancing example-based code search with functional semantics

delete2020-07-01
delete9
delete
OA
AI
Z
Zhengzhao Chen
R
Renhe Jiang
Z
Zejun Zhang
Y
Yu Pei
M
Minxue Pan
T
Tian Zhang *
X
Xuandong Li
DOI:10.1016/j.jss.2020.110568delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
As the quality and quantity of open source code increase, effective and efficient search for code implementing certain semantics, or semantics-based code search, has become an emerging need for software developers to retrieve and reuse existing source code. Previous techniques in semantics-based code search encode the semantics of loop-free Java code snippets as constraints and utilize an SMT solver to find encoded snippets that match an input/output (IO) query. We present in this article the Quebio approach to semantics-based search for Java methods. Quebio advances the state-of-the-art by supporting important language features like invocation to library APIs and enabling the search to handle more data types like array/List, Set, and Map. Compared with existing approaches, Quebio also integrates a customized keyword-based search that uses as the input a textual, behavioral summary of the desired methods to quickly prune the methods to be checked against the IO examples. To evaluate the effectiveness and efficiency of Quebio, we constructed a repository of 14,792 methods from 723 open source Java projects hosted on GitHub and applied the approach to resolve 47 queries extracted from Stack-Overflow. Quebio was able to find methods correctly implementing the specified IO behaviors for 43 of the queries, significantly outperforming the existing semantics-based code search techniques. The average search time with Quebio was 213.2 seconds for each query. (C) 2020 Elsevier Inc. All rights reserved.
Keywords:
Semantics-based code search
Symbolic analysis
SMT solver
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

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.4K
Citations:
8.4K

Organization

H
hong kong polytechnic university
Scholars:
3.0W
Papers: 4.1W
Citations: 921
N
nanjing university
Scholars:
7.7W
Papers: 5.6W
Citations: 87