Affiliation:
1. National Electronics and Computer Technology Center, Thailand
2. Oracle Corporation, Nashua, NH
Abstract
It is common practice for software developers to use
examples
to guide development efforts. This largely unwritten, yet standard, practice of "develop by example" is often supported by examples bundled with library or framework packages, provided in textbooks, and made available for download on both official and unofficial web sites. However, the vast number of examples that are embedded in the billions of lines of already developed library and framework code are largely untapped. We have developed
XSnippet
, a context-sensitive code assistant framework that allows developers to query a sample repository for code snippets that are relevant to the programming task at hand. In particular, our work makes three primary contributions. First, a range of queries is provided to allow developers to switch between a context-independent retrieval of code snippets to various degrees of context-sensitive retrieval for object instantiation queries. Second, a novel graph-based code mining algorithm is provided to support the range of queries and enable mining within and across method boundaries. Third, an innovative context-sensitive ranking heuristic is provided that has been experimentally proven to provide better ranking for best-fit code snippets than context-independent heuristics such as shortest path and frequency. Our experimental evaluation has shown that
XSnippet
has significant potential to assist developers, and provides better coverage of tasks and better rankings for best-fit snippets than other code assistant systems.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference19 articles.
1. How reuse influences productivity in object-oriented systems
2. Algorithm for documents ranking
3. P. Freeman. Software Reusability. IEEE Computer Society Press 10662 Los Vaqueros Circle Los Alamitos CA 90720 USA 1987. P. Freeman. Software Reusability. IEEE Computer Society Press 10662 Los Vaqueros Circle Los Alamitos CA 90720 USA 1987.
4. Software component search
Cited by
98 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. ASTSDL: predicting the functionality of incomplete programming code via an AST-sequence-based deep learning model;Science China Information Sciences;2023-12-27
2. Big Code Search: A Bibliography;ACM Computing Surveys;2023-08-26
3. An empirical study on API usages from code search engine and local library;Empirical Software Engineering;2023-04-13
4. Context-aware code recommendation in Intellij IDEA;Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2022-11-07
5. Generating Examples from CLI Usage: Can Transformers Help?;Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining;2022-08-14