SoCeR: A New Source Code Recommendation Technique for Code Reuse

Abstract

Motivated by the idea of reusing existing source code from previous projects within a software company, in this paper, we present a new source code recommendation technique called 'SoCeR' to help programmers find relevant implementations or sample code based on software requirement specifications. SoCeR assists programmers to search existing code repositories using natural language query. Our proposed approach summarizes Python code into sentences or phrases to match them against user queries. SoCeR extracts and analyzes the content of the code (such as variables, functions, docstrings, and comments) to generate code summary for each function which is then mapped to the respective functions. For evaluation purposes, we developed a web-based tool for users to enter a textual search query and get the relevant code search results that were most relevant to the query. In SoCeR, users can also upload new code to enrich the code base with tested code. If adopted, then SoCeR will benefit a software company to build a trusted code base enabling large-scale software code reuse.

Document Type

Conference Proceeding

DOI

https://doi.org/10.1109/COMPSAC48688.2020.00-34

Keywords

Code recommendation, Code reuse, Code search, Query reformulation, Software code

Publication Date

7-1-2020

Journal Title

Proceedings - 2020 IEEE 44th Annual Computers, Software, and Applications Conference, COMPSAC 2020

Share

COinS