Clone-Seeker: Effective Code Clone Search Using Annotations

06/06/2021
by   Muhammad Hammad, et al.
0

Source code search plays an important role in software development, e.g. for exploratory development or opportunistic reuse of existing code from a code base. Often, exploration of different implementations with the same functionality is needed for tasks like automated software transplantation, software diversification, and software repair. Code clones, which are syntactically or semantically similar code fragments, are perfect candidates for such tasks. Searching for code clones involves a given search query to retrieve the relevant code fragments. We propose a novel approach called Clone-Seeker that focuses on utilizing clone class features in retrieving code clones. For this purpose, we generate metadata for each code clone in the form of a natural language document. The metadata includes a pre-processed list of identifiers from the code clones augmented with a list of keywords indicating the semantics of the code clone. This keyword list can be extracted from a manually annotated general description of the clone class, or automatically generated from the source code of the entire clone class. This approach helps developers to perform code clone search based on a search query written either as source code terms, or as natural language. In our quantitative evaluation, we show that (1) Clone-Seeker has a higher recall when searching for semantic code clones (i.e., Type-4) in BigCloneBench than the state-of-the-art; and (2) Clone-Seeker can accurately search for relevant code clones by applying natural language queries.

READ FULL TEXT
research
07/12/2018

RACK: Code Search in the IDE using Crowdsourced Knowledge

Traditional code search engines often do not perform well with natural l...
research
06/08/2017

Source Forager: A Search Engine for Similar Source Code

Developers spend a significant amount of time searching for code: e.g., ...
research
05/29/2020

Simplifying Deep-Learning-Based Model for Code Search

To accelerate software development, developers frequently search and reu...
research
03/28/2019

Crowd Sourced Data Analysis: Mapping of Programming Concepts to Syntactical Patterns

Since programming concepts do not match their syntactic representations,...
research
07/22/2020

DeepClone: Modeling Clones to Generate Code Predictions

During software development, programmers often tend to reuse the code fo...
research
05/07/2023

Synthesizing Conjunctive Queries for Code Search

This paper presents Squid, a new conjunctive query synthesis algorithm f...
research
10/11/2021

Searching for Replacement Classes

Software developers must often replace existing components in their syst...

Please sign up or login with your details

Forgot password? Click here to reset