Code Search: A Survey of Techniques for Finding Code
arXiv:2204.02765 · doi:10.1145/3565971
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.
References in corpus (8)
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation
- Query Expansion Based on Crowd Knowledge for Code Search
- Deep Graph Matching and Searching for Semantic Code Retrieval
- Opportunities and Challenges in Code Search Tools
- Code Search based on Context-aware Code Translation
- Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual Learning
- Cross-Domain Deep Code Search with Meta Learning
- Cross-Language Code Search using Static and Dynamic Analyses