CCR : Tree-pattern based Code-clone Detector

CCR : 트리패턴 기반의 코드클론 탐지기

  • 이효섭 (한양대학교 컴퓨터공학과) ;
  • 도경구 (한양대학교 컴퓨터공학과)
  • Received : 2012.12.20
  • Accepted : 2012.12.25
  • Published : 2012.12.30

Abstract

This paper presents a tree-pattern based code-clone detector as CCR(Code Clone Ransacker) that finds all clusterd dulpicate pattern by comparing all pair of subtrees in the programs. The pattern included in its entirely in another pattern is ignored since only the largest duplicate patterns are interesed. Evaluation of CCR is high precision and recall. The previous tree-pattern based code-clone detectors are known to have good precision and recall because of comparing program structure. CCR is still high precision and the maximum 5 times higher recall than Asta and about 1.9 times than CloneDigger. The tool also include the majority of Bellon's reference corpus.

본 연구에서는 트리패턴 기반으로 코드클론을 탐지하는 도구인 CCR(Code Clone Ransacker)를 제안하고 구현하였다. CCR은 프로그램 트리의 모든 하위트리 쌍을 비교하여 중복된 부분인 트리패턴을 찾고 동일한 모양의 패턴들을 하나로 묶어 프로그램에 존재하는 클론들을 샅샅이 탐지한다. 이때 이미 찾은 패턴 내부의 클론 패턴을 비교대상에서 제외하여 중복계산을 하지 않아 불필요한 예산을 최대한 줄인다. 실험으로 CCR의 성능을 평가한 결과, CCR의 정확성과 탐지성은 높다. 프로그램의 구조를 비교하는 기존의 트리패턴 기반의 코드클론 탐지 도구들의 정확성과 탐지성은 이미 좋은 것으로 알려져 있지만, CCR은 높은 정확성을 유지하면서 탐지성은 기존의 Asta보다는 최대 5배, CloneDigger보다는 약 1.9배 높다. 그리고 CCR이 찾은 코드클론은 기존의 코드클론 표본 집합체의 클론을 대부분 포함한다.

Keywords

Acknowledgement

본 연구는 교육과학기술부/한국연구재단 우수연구센터 육성사업의 지원으로 수행되었음(과제번호 2012-0000469).