Code Search: A Survey of Techniques for Finding Code
Open Access
- 9 February 2023
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Computing Surveys
- Vol. 55 (11) , 1-31
Abstract
The immense amounts of source code provide ample challenges and opportunities during software development. To handle the size of code bases, developers commonly search for code, e.g., when trying to find where a particular feature is implemented or when looking for code examples to reuse. To support developers in finding relevant code, various code search engines have been proposed. This article surveys 30 years of research on code search, giving a comprehensive overview of challenges and techniques that address them. We discuss the kinds of queries that code search engines support, how to preprocess and expand queries, different techniques for indexing and retrieving code, and ways to rank and prune search results. Moreover, we describe empirical studies of code search in practice. Based on the discussion of prior work, we conclude the article with an outline of challenges and opportunities to be addressed in the future.Keywords
All Related Versions
Funding Information
- European Research Council (851895)
- German Research Foundation within the ConcSys and DeMoCo
This publication has 59 references indexed in Scilit:
- How Well Do Search Engines Support Code Retrieval on the Web?ACM Transactions on Software Engineering and Methodology, 2011
- Feature location in source code: a taxonomy and surveyJournal of Software: Evolution and Process, 2011
- A test-driven approach to code search and its application to the reuse of auxiliary functionalityInformation and Software Technology, 2011
- Analyzing and mining a code search engine usage logEmpirical Software Engineering, 2010
- Sourcerer: mining and searching internet-scale software repositoriesData Mining and Knowledge Discovery, 2008
- A survey and taxonomy of approaches for mining software repositories in the context of software evolutionJournal of Software Maintenance and Evolution: Research and Practice, 2007
- The anatomy of a large-scale hypertextual Web search engineComputer Networks and ISDN Systems, 1998
- A framework for source code search using program patternsIEEE Transactions on Software Engineering, 1994
- Retrieving reusable software by sampling behaviorACM Transactions on Software Engineering and Methodology, 1993
- Extended Boolean information retrievalCommunications of the ACM, 1983