Skip to main content
QUICK REVIEW

[Paper Review] LVMapper: A Large-variance Clone Detector Using Sequencing Alignment Approach

Ming Wu, Pengcheng Wang|arXiv (Cornell University)|Sep 10, 2019
Software Engineering ResearchComputer Science41 references4 citations
TL;DR

LVMapper is a novel clone detection tool that leverages sequencing alignment principles from bioinformatics to identify large-variance code clones—those with scattered or concentrated modifications—by using a seed-and-extend strategy with dynamic thresholding. It achieves superior recall and precision on both synthetic and real-world datasets, outperforming state-of-the-art tools like CCAligner and SourcererCC in detecting Type-3 clones with high variance.

ABSTRACT

To detect large-variance code clones (i.e. clones with relatively more differences) in large-scale code repositories is difficult because most current tools can only detect almost identical or very similar clones. It will make promotion and changes to some software applications such as bug detection, code completion, software analysis, etc. Recently, CCAligner made an attempt to detect clones with relatively concentrated modifications called large-gap clones. Our contribution is to develop a novel and effective detection approach of large-variance clones to more general cases for not only the concentrated code modifications but also the scattered code modifications. A detector named LVMapper is proposed, borrowing and changing the approach of sequencing alignment in bioinformatics which can find two similar sequences with more differences. The ability of LVMapper was tested on both self-synthetic datasets and real cases, and the results show substantial improvement in detecting large-variance clones compared with other state-of-the-art tools including CCAligner. Furthermore, our new tool also presents good recall and precision for general Type-1, Type-2 and Type-3 clones on the widely used benchmarking dataset, BigCloneBench.

Motivation & Objective

  • Address the gap in detecting large-variance code clones, especially those with scattered modifications, which existing tools often miss.
  • Improve clone detection for Type-3 clones, which are challenging due to syntactic divergence despite semantic similarity.
  • Develop a scalable and precise method that maintains high performance even when code modifications are extensive and non-concentrated.
  • Overcome limitations of existing tools like CCAligner, which focus only on large-gap (concentrated) modifications, and SourcererCC, which sacrifices accuracy at lower thresholds.
  • Enable better support for software engineering tasks such as bug detection, code completion, and refactoring by identifying homologous, highly modified clones.

Proposed method

  • Adopt a seed-and-extend strategy inspired by third-generation sequencing alignment, using small, fixed-size windows (seeds) of consecutive lines to efficiently locate candidate clone pairs.
  • Apply a heuristic algorithm to verify clones based on the presence of order-preserving code line sequences, which is more efficient than traditional Longest Common Subsequence (LCS) computation.
  • Introduce a dynamic threshold mechanism that adjusts based on code size, enabling detection of clones with higher modification variance while preserving precision.
  • Use a filtering step based on seed matching to reduce false positives before full verification, minimizing computational overhead.
  • Leverage lexical similarity and structural preservation as indicators of clone relationships, focusing on homologous modifications common in software evolution.
  • Implement a scalable architecture that processes large codebases efficiently, achieving 3-hour runtime on a 30M-LOC dataset.

Experimental results

Research questions

  • RQ1Can a sequencing alignment-inspired approach effectively detect large-variance code clones with scattered modifications, beyond the scope of current tools?
  • RQ2How does LVMapper’s dynamic thresholding strategy impact recall and precision across varying levels of code modification?
  • RQ3To what extent does LVMapper outperform state-of-the-art tools like CCAligner, SourcererCC, and CCFinderX in detecting Type-3 clones with high variance?
  • RQ4How does LVMapper perform on real-world software projects and synthetic benchmarks compared to existing methods in terms of scalability and accuracy?
  • RQ5Can the proposed method detect clones in both homologous and heterologous development scenarios, particularly those with semantic overlap but syntactic divergence?

Key findings

  • LVMapper significantly outperforms CCAligner in detecting large-variance clones, especially in cases with scattered modifications, which CCAligner fails to capture.
  • On the BigCloneBench dataset, LVMapper achieves better recall and precision for Moderately Type-3 and Weakly Type-3&4 clones compared to other tools, indicating improved detection of syntactic variants.
  • The tool maintains high precision even at high modification rates due to its dynamic thresholding mechanism, which adapts to code size and complexity.
  • LVMapper demonstrates strong scalability, processing a 30M-LOC codebase in approximately 3 hours, suggesting feasibility for large-scale software repositories.
  • The heuristic verification algorithm reduces computational cost compared to full LCS computation while preserving detection accuracy.
  • Experiments show that large-variance clones constitute up to half or more of Type-3 clones in some datasets, highlighting the importance of detecting such clones.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.