Solving the Search for Source Code

Author:

Stolee Kathryn T.1,Elbaum Sebastian2,Dobos Daniel2

Affiliation:

1. Iowa State University, Ames, IA

2. University of Nebraska-Lincoln, Lincoln, NE

Abstract

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.

Funder

UNL-UCARE Program

Google

National Science Foundation

Air Force Office of Scientific Research

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Cited by 84 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Code search engines for the next generation;Journal of Systems and Software;2024-09

2. C2B: A Semantic Source Code Retrieval Model Using CodeT5 and Bi-LSTM;Applied Sciences;2024-07-02

3. Survey of Code Search Based on Deep Learning;ACM Transactions on Software Engineering and Methodology;2023-12-23

4. A Systematic Review of Automated Query Reformulations in Source Code Search;ACM Transactions on Software Engineering and Methodology;2023-09-28

5. Big Code Search: A Bibliography;ACM Computing Surveys;2023-08-26

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3