XSnippet: Mining For Sample Code |
XSnippet: Mining For Sample CodeResearch Paper Thursday, Oct 26, from 15:30 to 17:00
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. The vast number of examples that are embedded in the billions of lines of already developed library and framework code are, however, 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 on hand. In particular, our work makes three primary contributions. First, we provide a range of queries that allow developers to decide to switch between a context-independent retrieval of code snippets to various degrees of context-sensitive retrieval. Second, we provide a novel graph-based code mining algorithm that supports the range of queries, and enables mining within and across method boundaries. Third, we provide an innovative context-sensitive ranking heuristic that has 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, it provides better coverage of tasks, and better rankings for best-fit snippets than other code assistant systems. Naiyana Tansalarak, UMass - Lowell Kajal Claypool, UMass - Lowell
|