Key takeaways
- Aroma is a new machine learning tool designed to recommend suitable code snippets to developers.
- The tool helps developers find common coding patterns without manually sifting through large codebases.
- Aroma aims to enhance efficiency by saving time and energy in the development workflow.
- The increasing volume of code highlights the need for tools that can simplify coding processes.

A code snippet is fragmented as above and the result of the dot product of a sparse vector with the feature vectors is used as a threshold for recommendation.
All possible code recommendations with similarities to the original snippet will be clustered.
Since dot product alone cannot avoid the abstractions of the components in a code, pruning is used to rank the similarity.
This cluster of potential candidates are skimmed through iteratively for extra statements useful for recommendations. The remaining code after pruning is recommended eventually.
Aroma is put to test by pitting it against top voted answers to 500 most popular questions asked on Stack Overflow. The Java code from each snippet is extracted by excluding comments. Then AROMA’s recommendations are checked for similarities in the lines used in top voted answers, which are picked randomly.
The recommended code also performs additional operations like showing API methods called in the query code and suggests related statements that commonly appear in the query code. The results show that AROMA takes 1.6 seconds before it recommends a code.
Aroma eclipses its counterparts with the following advantages:
- Aroma performs search on syntax trees. It can find instances that are syntactically similar to the query code and highlight the matching code.
- Aroma automatically clusters together similar search results to generate code recommendations.
- Creates real-time recommendations for very large codebases and does not require pattern mining ahead of time.
- Deployed across codebases in Hack, JavaScript, Python, and Java





