Code Search: A Survey of Techniques for Finding Code

被引:23
作者
Di Grazia, Luca [1 ]
Pradel, Michael [1 ]
机构
[1] Univ Stuttgart, Dept Comp Sci, Univ Str 38, D-70569 Stuttgart, Germany
基金
欧洲研究理事会;
关键词
Code search; code retrieval; API; learning; survey; SOFTWARE MAINTENANCE; QUERIES; CONTEXT; ENGINE; INFORMATION; DEVELOPERS; TAXONOMY;
D O I
10.1145/3565971
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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.
引用
收藏
页数:31
相关论文
共 139 条
[1]  
Aho A., 1986, COMPILERS PRINCIPLES
[2]  
Akbar S., 2019, P IEEEACM 16 INT C M, P1
[3]   API Code Recommendation using Statistical Learning from Fine-Grained Changes [J].
Anh Tuan Nguyen ;
Hilton, Michael ;
Codoban, Mihai ;
Hoan Anh Nguyen ;
Mast, Lily ;
Rademacher, Eli ;
Nguyen, Tien N. ;
Dig, Danny .
FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, :511-522
[4]  
[Anonymous], 1998, 14882 ISOIEC
[5]  
[Anonymous], 2011, ECMA262
[6]  
[Anonymous], 2006, COMP 21 ACM SIGPLAN
[7]  
[Anonymous], 2007, QUEENS SCH COMPUT T
[8]   Efficient Indexing of Billion-Scale datasets of deep descriptors [J].
Babenko, Artem ;
Lempitsky, Victor .
2016 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), 2016, :2055-2063
[9]  
Bajracharya S.K., 2010, Proceedings of the 18th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2010, Santa Fe, NM, USA, November 7-11, 2010, P157, DOI DOI 10.1145/1882291.1882316
[10]   Mining Search Topics from a Code Search Engine Usage Log [J].
Bajracharya, Sushil ;
Lopes, Cristina .
2009 6TH IEEE INTERNATIONAL WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES, 2009, :111-120