# Aroma: Code Recommendation via Structural Code Search

**Authors:** Sifei Luan, Di Yang, Celeste Barnaby, Koushik Sen, Satish Chandra

arXiv: 1812.01158 · 2019-10-21

## TL;DR

Aroma is a code recommendation tool that uses structural code search across large open-source corpora to suggest relevant code snippets, aiding programmers in extending, fixing, and understanding code more effectively.

## Contribution

Aroma introduces a novel structural code search technique for code recommendation, indexing extensive open-source code and providing efficient, contextually relevant snippet suggestions.

## Key findings

- Aroma effectively retrieves relevant code snippets from large corpora.
- Aroma's recommendations improve programmer productivity in coding tasks.
- The tool performs well across multiple programming languages.

## Abstract

Programmers often write code that has 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 included by other programmers, help to cross-check against similar code written by other programmers, or help to add extra code which would fix 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 corpus for method bodies containing the partial code snippet, and clusters and intersects the results of the search to recommend a small set of succinct code snippets which both contain the query snippet and appear as part of several methods in the corpus. We evaluated Aroma on 2000 randomly selected queries created from the corpus, as well as 64 queries derived from code snippets obtained from Stack Overflow, a popular website for discussing code. We implemented Aroma for 4 different languages, and developed an IDE plugin for Aroma. Furthermore, we conducted a study where we asked 12 programmers to complete programming tasks using Aroma, and collected their feedback. Our results indicate that Aroma is capable of retrieving and recommending relevant code snippets efficiently.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1812.01158/full.md

## Figures

15 figures with captions in the complete paper: https://tomesphere.com/paper/1812.01158/full.md

## References

44 references — full list in the complete paper: https://tomesphere.com/paper/1812.01158/full.md

---
Source: https://tomesphere.com/paper/1812.01158