The search functionality is under construction.
The search functionality is under construction.

CLCMiner: Detecting Cross-Language Clones without Intermediates

Xiao CHENG, Zhiming PENG, Lingxiao JIANG, Hao ZHONG, Haibo YU, Jianjun ZHAO

  • Full Text Views

    0

  • Cite this

Summary :

The proliferation of diverse kinds of programming languages and platforms makes it a common need to have the same functionality implemented in different languages for different platforms, such as Java for Android applications and C# for Windows phone applications. Although versions of code written in different languages appear syntactically quite different from each other, they are intended to implement the same software and typically contain many code snippets that implement similar functionalities, which we call cross-language clones. When the version of code in one language evolves according to changing functionality requirements and/or bug fixes, its cross-language clones may also need be changed to maintain consistent implementations for the same functionality. Thus, it is needed to have automated ways to locate and track cross-language clones within the evolving software. In the literature, approaches for detecting cross-language clones are only for languages that share a common intermediate language (such as the .NET language family) because they are built on techniques for detecting single-language clones. To extend the capability of cross-language clone detection to more diverse kinds of languages, we propose a novel automated approach, CLCMiner, without the need of an intermediate language. It mines such clones from revision histories, based on our assumption that revisions to different versions of code implemented in different languages may naturally reflect how programmers change cross-language clones in practice, and that similarities among the revisions (referred to as clones in diffs or diff clones) may indicate actual similar code. We have implemented a prototype and applied it to ten open source projects implementations in both Java and C#. The reported clones that occur in revision histories are of high precisions (89% on average) and recalls (95% on average). Compared with token-based code clone detection tools that can treat code as plain texts, our tool can detect significantly more cross-language clones. All the evaluation results demonstrate the feasibility of revision-history based techniques for detecting cross-language clones without intermediates and point to promising future work.

Publication
IEICE TRANSACTIONS on Information Vol.E100-D No.2 pp.273-284
Publication Date
2017/02/01
Publicized
2016/11/21
Online ISSN
1745-1361
DOI
10.1587/transinf.2016EDP7334
Type of Manuscript
PAPER
Category
Software Engineering

Authors

Xiao CHENG
  Shanghai Jiao Tong University
Zhiming PENG
  Singapore Management University
Lingxiao JIANG
  Singapore Management University
Hao ZHONG
  Shanghai Jiao Tong University
Haibo YU
  Shanghai Jiao Tong University
Jianjun ZHAO
  Kyushu University

Keyword