Aroma: Code Recommendation via Structural Code Search

12/04/2018
by   Sifei Luan, et al.
0

Programmers often write code which have similarity to existing code written somewhere. A tool that could help programmers to search such similar code would be immensely useful. Such a tool could help programmers to extend partially written code snippets to completely implement necessary functionality, help to discover extensions to the partial code which are commonly done by other programmers, help to cross-check against similar code written by other programmers, or help to add extra code which would avoid common mistakes and errors. We propose Aroma, a tool and technique for code recommendation via structural code search. Aroma indexes a huge code corpus including thousands of open-source projects, takes a partial code snippet as input, searches the indexed method bodies which contain the partial code snippet, clusters and intersects the results of search to recommend a small set of succinct code snippets which contain the query snippet and which appears as part of several programs in the corpus. We evaluated Aroma on several randomly selected queries created from the corpus and as well as those derived from the code snippets obtained from Stack Overflow, a popular website for discussing code. We found that Aroma was able to retrieve and recommend most relevant code snippets efficiently.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset