Skip to main navigation Skip to search Skip to main content

A picture is worth a thousand words: Code clone detection based on image similarity

  • University College London
  • Prodo.ai

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

30 Citations (Scopus)

Abstract

This paper introduces a new code clone detection technique based on image similarity. The technique captures visual perception of code seen by humans in an IDE by applying syntax highlighting and images conversion on raw source code text. We compared two similarity measures, Jaccard and earth mover's distance (EMD) for our image-based code clone detection technique. Jaccard similarity offered better detection performance than EMD. The F1 score of our technique on detecting Java clones with pervasive code modifications is comparable to five well-known code clone detectors: CCFinderX, Deckard, iClones, NiCad, and Simian. A Gaussian blur filter is chosen as a normalisation technique for type-2 and type-3 clones. We found that blurring code images before similarity computation resulted in higher precision and recall. The detection performance after including the blur filter increased by 1 to 6 percent. The manual investigation of clone pairs in three software systems revealed that our technique, while it missed some of the true clones, could also detect additional true clone pairs missed by NiCad.

Original languageEnglish
Title of host publication2018 IEEE 12th International Workshop on Software Clones, IWSC 2018 - Proceedings
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages44-50
Number of pages7
ISBN (Electronic)9781538664308
DOIs
Publication statusPublished - 27 Mar 2018
Externally publishedYes
Event12th IEEE International Workshop on Software Clones, IWSC 2018 - Campobasso, Italy
Duration: 20 Mar 2018 → …

Publication series

Name2018 IEEE 12th International Workshop on Software Clones, IWSC 2018 - Proceedings
Volume2018-January

Conference

Conference12th IEEE International Workshop on Software Clones, IWSC 2018
Country/TerritoryItaly
CityCampobasso
Period20/03/18 → …

Fingerprint

Dive into the research topics of 'A picture is worth a thousand words: Code clone detection based on image similarity'. Together they form a unique fingerprint.

Cite this