# Aroma: Code Recommendation via Structural Code Search

arXiv: https://arxiv.org/abs/1812.01158 · HTML: https://mlsanity.com/paper/1812.01158/

## Key facts

- Cited by 29 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 4 Dec 2018.

## Built on by (most cited first, 29 of 29)

- [CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation](https://mlsanity.com/paper/2102.04664/) (2021)
- [CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks](https://mlsanity.com/paper/2105.12655/) (2021)
- [ReACC: A Retrieval-Augmented Code Completion Framework](https://mlsanity.com/paper/2203.07722/) (2022)
- [How could Neural Networks understand Programs?](https://mlsanity.com/paper/2105.04297/) (2021)
- [RAPGen: An Approach for Fixing Code Inefficiencies in Zero-Shot](https://mlsanity.com/paper/2306.17077/) (2023)
- [Code Recommendation for Open Source Software Developers](https://mlsanity.com/paper/2210.08332/) (2022)
- [Multimodal Representation for Neural Code Search](https://mlsanity.com/paper/2107.00992/) (2021)
- [Toward Code Generation: A Survey and Lessons from Semantic Parsing](https://mlsanity.com/paper/2105.03317/) (2021)
- [CodeS: Towards Code Model Generalization Under Distribution Shift](https://mlsanity.com/paper/2206.05480/) (2022)
- [DeepPERF: A Deep Learning-Based Approach For Improving Software Performance](https://mlsanity.com/paper/2206.13619/) (2022)
- [GenCodeSearchNet: A Benchmark Test Suite for Evaluating Generalization in Programming Language Understanding](https://mlsanity.com/paper/2311.09707/) (2023)
- [Autoencoders as Tools for Program Synthesis](https://mlsanity.com/paper/2108.07129/) (2021)
- [InvAASTCluster: On Applying Invariant-Based Program Clustering to Introductory Programming Assignments](https://mlsanity.com/paper/2206.14175/) (2022)
- [Senatus -- A Fast and Accurate Code-to-Code Recommendation Engine](https://mlsanity.com/paper/2111.04473/) (2021)
- [SapientML: Synthesizing Machine Learning Pipelines by Learning from Human-Written Solutions](https://mlsanity.com/paper/2202.10451/) (2022)
- [GitRank: A Framework to Rank GitHub Repositories](https://mlsanity.com/paper/2205.02360/) (2022)
- [Towards Top-Down Automated Development in Limited Scopes: A Neuro-Symbolic Framework from Expressibles to Executables](https://mlsanity.com/paper/2209.01566/) (2022)
- [LogicLens: Leveraging Semantic Code Graph to explore Multi Repository large systems](https://mlsanity.com/paper/2601.10773/) (2026)
- [Addressing Leakage in Self-Supervised Contextualized Code Retrieval](https://mlsanity.com/paper/2204.11594/) (2022)
- [Are Machine Programming Systems using Right Source-Code Measures to Select Code Repositories?](https://mlsanity.com/paper/2209.11946/) (2022)
- [Implant Global and Local Hierarchy Information to Sequence based Code Representation Models](https://mlsanity.com/paper/2303.07826/) (2023)
- [Deduplicating and Ranking Solution Programs for Suggesting Reference Solutions](https://mlsanity.com/paper/2307.07940/) (2023)
- [Report of the Workshop on Program Synthesis for Scientific Computing](https://mlsanity.com/paper/2102.01687/) (2021)
- [Code Sophistication: From Code Recommendation to Logic Recommendation](https://mlsanity.com/paper/2201.07674/) (2022)
- [CV4Code: Sourcecode Understanding via Visual Code Representations](https://mlsanity.com/paper/2205.08585/) (2022)
- [CSSAM:Code Search via Attention Matching of Code Semantics and Structures](https://mlsanity.com/paper/2208.03922/) (2022)
- [API-Miner: an API-to-API Specification Recommendation Engine](https://mlsanity.com/paper/2212.07253/) (2022)
- [A Study of Variable-Role-based Feature Enrichment in Neural Models of Code](https://mlsanity.com/paper/2303.04942/) (2023)
- [CodeScholar: Growing Idiomatic Code Examples](https://mlsanity.com/paper/2312.15157/) (2023)

## Abstract (arXiv)

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.
