DeSkew-LSH based Code-to-Code Recommendation Engine

11/05/2021
by   Fran Silavong, et al.
12

Machine learning on source code (MLOnCode) is a popular research field that has been driven by the availability of large-scale code repositories and the development of powerful probabilistic and deep learning models for mining source code. Code-to-code recommendation is a task in MLOnCode that aims to recommend relevant, diverse and concise code snippets that usefully extend the code currently being written by a developer in their development environment (IDE). Code-to-code recommendation engines hold the promise of increasing developer productivity by reducing context switching from the IDE and increasing code-reuse. Existing code-to-code recommendation engines do not scale gracefully to large codebases, exhibiting a linear growth in query time as the code repository increases in size. In addition, existing code-to-code recommendation engines fail to account for the global statistics of code repositories in the ranking function, such as the distribution of code snippet lengths, leading to sub-optimal retrieval results. We address both of these weaknesses with Senatus, a new code-to-code recommendation engine. At the core of Senatus is De-Skew LSH a new locality sensitive hashing (LSH) algorithm that indexes the data for fast (sub-linear time) retrieval while also counteracting the skewness in the snippet length distribution using novel abstract syntax tree-based feature scoring and selection algorithms. We evaluate Senatus via automatic evaluation and with an expert developer user study and find the recommendations to be of higher quality than competing baselines, while achieving faster search. For example, on the CodeSearchNet dataset we show that Senatus improves performance by 6.7% F1 and query time 16x is faster compared to Facebook Aroma on the task of code-to-code recommendation.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/20/2018

A Large-Scale Study on Source Code Reviewer Recommendation

Context: Software code reviews are an important part of the development ...
research
08/15/2019

Semantic Source Code Search: A Study of the Past and a Glimpse at the Future

With the recent explosion in the size and complexity of source codebases...
research
03/29/2022

Accelerating Code Search with Deep Hashing and Code Classification

Code search is to search reusable code snippets from source code corpus ...
research
05/06/2020

Enhancing Software Development Process (ESDP) using Data Mining Integrated Environment

Nowadays, it has become a basic need to reuse existing Application Progr...
research
08/07/2023

Search Engine and Recommendation System for the Music Industry built with JinaAI

One of the most intriguing debates regarding a novel task is the develop...
research
10/02/2020

Augmenting Machine Learning with Information Retrieval to Recommend Real Cloned Code Methods for Code Completion

Software developers frequently reuse source code from repositories as it...
research
08/29/2018

Retrieval-Based Neural Code Generation

In models to generate program source code from natural language, represe...

Please sign up or login with your details

Forgot password? Click here to reset