Cross-Language Clone Detection based on Common Token

공통 토큰에 기반한 서로 다른 언어의 유사성 검사

  • 홍성문 (한양대학교 ERICA 대학원 컴퓨터공학과) ;
  • 김현하 (소프토피아(주)) ;
  • 이제형 (한양대학교 ERICA 소프트웨어학부) ;
  • 박성우 (한양대학교 ERICA 소프트웨어학부) ;
  • 모지환 (한양대학교 ERICA 소프트웨어학부) ;
  • 도경구 (한양대학교 ERICA 소프트웨어학부)
  • Received : 2018.11.30
  • Accepted : 2018.12.21
  • Published : 2018.12.31

Abstract

Tools for detecting cross-language clones usually compare abstract-syntax-tree representations of source code, which lacks scalability. In order to compare large source code to a practical level, we need a similarity checking technique that works on a token level basis. In this paper, we define common tokens that represent all tokens commonly used in programming languages of different paradigms. Each source code of different language is then transformed into the list of common tokens that are compared. Experimental results using exEyes show that our proposed method using common tokens is effective in detecting cross-language clones.

서로 다른 언어로 작성된 소스코드의 유사성 검사는 주로 요약구문트리를 기반으로 비교를 수행한다. 하지만 대규모의 소스코드를 실용적인 수준으로 비교하려면 토큰수준 기반에서 작동하는 유사성 검사 기술이 필요하다. 본 연구에서는 서로 다른 언어에서 생성되었지만 같은 의미를 지닌 토큰을 표현할 수 있는 공통 토큰을 정의하고, 소스코드에서 언어별 처리 과정을 거쳐 생성한 공통 토큰의 나열을 입력으로 소스코드의 유사성 검사를 수행하는 방법을 제안한다. 한국저작권위원회의 표절검사 도구 exEyes를 사용해서 서로 다른 언어로 작성된 동일한 코드를 대상으로 실험한 결과, 제안한 방법을 사용했을 때, 유사성 평가 성능이 향상됨을 보였다.

Keywords

Acknowledgement

본 연구는 과학기술정보통신부 및 정보통신기술진흥센터의 SW중심대학지원사업의 연구결과로 수행되었음 (201800000001473)