A scalable and accurate approach based on count matrix for detecting code clones

  • Authors:
  • Yang Yuan

  • Affiliations:
  • Peking University, Beijing, China

  • Venue:
  • Proceedings of the 11th annual international conference on Aspect-oriented Software Development Companion
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, we introduce a new token based algorithm for code clone detection. Count Environment(CE) is certain scenario related to variables. Count Vector(CV) for one variable is consisted of counting occurrences of this variable in different CEs. Count Matrix(CM) for one code fragment is consisted of different CVs of all variables in the code fragment. We use CVs to depict variables, and use CM to represent a code fragment. Two code fragments will be compared by their corresponding CMs, and during the comparison, two heuristics are used. Experimental results show that our algorithm is significantly faster than Deckard, a state-of-the-art syntactic technique for detecting code clones.