Code Clone Matching: A Practical and Effective Approach to Find Code Snippets

03/12/2020
by   Katsuro Inoue, et al.
0

Finding the same or similar code snippets in source code is one of fundamental activities in software maintenance. Text-based pattern matching tools such as grep is frequently used for such purpose, but making proper queries for the expected result is not easy. Code clone detectors could be used but their features and result are generally excessive. In this paper, we propose Code Clone matching (CC matching for short) that employs a combination of token-based clone detection and meta-patterns enhanced with meta-tokens. The user simply gives a query code snippet possibly with a few meta-tokens and then gets the resulting snippets, forming type 1, 2, or 3 code clone pairs between the query and result. By using a code snippet with meta-tokens as the query, the resulting matches are well controlled by the users. CC matching has been implemented as a practical and efficient tool named ccgrep, with grep-like user interface. The evaluation shows that ccgrep  is a very effective to find various kinds of code snippets.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/03/2018

The Effectiveness of Low-Level Structure-based Approach Toward Source Code Plagiarism Level Taxonomy

Low-level approach is a novel way to detect source code plagiarism. Such...
research
03/26/2020

On-the-Fly Adaptation of Source Code Models using Meta-Learning

The ability to adapt to unseen, local contexts is an important challenge...
research
04/21/2022

Non-autoregressive Model for Full-line Code Completion

Code completion tools are frequently used by software developers to acce...
research
04/06/2022

DiffSearch: A Scalable and Precise Search Engine for Code Changes

The source code of successful projects is evolving all the time, resulti...
research
05/08/2020

Corrigendum to Improve Language Modelling for Code Completion through Learning General Token Repetition of Source Code

This paper is written because I receive several inquiry emails saying it...
research
05/28/2022

A New High-Performance Approach to Approximate Pattern-Matching for Plagiarism Detection in Blockchain-Based Non-Fungible Tokens (NFTs)

We are presenting a fast and innovative approach to performing approxima...

Please sign up or login with your details

Forgot password? Click here to reset