Clone-Seeker: Effective Code Clone Search Using Annotations
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.
Code (0)
등록된 구현이 없습니다.
Tasks
Code SearchNatural Language QueriesSimilar Papers 제목 키워드 기반
CCT-Code: Cross-Consistency Training for Multilingual Clone Detection and Code Search
We consider the well-known and important tasks of clone detection and information retrieval for source code. The most standard setup is to search clones inside the same language code snippets. But it is also useful to fi…
Clone DetectionCode SearchDecoderInformation Retrieval+1On the Use of Deep Learning Models for Semantic Clone Detection
Detecting and tracking code clones can ease various software development and maintenance tasks when changes in a code fragment should be propagated over all its copies. Several deep learning-based clone detection models …
Clone DetectionDeep LearningAssessing the Code Clone Detection Capability of Large Language Models
This study aims to assess the performance of two advanced Large Language Models (LLMs), GPT-3.5 and GPT-4, in the task of code clone detection. The evaluation involves testing the models on a variety of code pairs of dif…
Clone DetectionCode GenerationDetecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Tree
Code clones are semantically similar code fragments pairs that are syntactically similar or different. Detection of code clones can help to reduce the cost of software maintenance and prevent bugs. Numerous approaches of…
Clone DetectionLeveraging Code Clones and Natural Language Processing for Log Statement Prediction
Software developers embed logging statements inside the source code as an imperative duty in modern software development as log files are necessary for tracking down runtime system issues and troubleshooting system manag…
Clone DetectionManagementPrediction