CoChat

Code2Img: Tree-Based Image Transformation for Scalable Code Clone Detection

Hu, Yutao, Fang, Yilin, Sun, Yifan, Jia, Yaru, Wu, Yueming, Zou, Deqing, Jin, Hai · 2023 · IEEE Transactions on Software Engineering

The DOI matches its Crossref record; 7 of the 7 references it cites were found in a registry or an index.

Abstract

Code clone detection is an active research domain of software engineering. There are two core demands for clone detection: scalable detection and complicated clone detection. For scalable detection, existing approaches treat the source code as a text or token sequence and then calculate their similarity. However, the text-based and token-based approaches are difficult to detect complicated clone types due to the lack of consideration of code structure. The methods based on intermediate representations of code can effectively achieve complex clone types detection but are limited by the complexity of representations to be scalable. In this paper, we proposeCode2Img, a tree-based code clone detector, which satisfies scalability while detecting complicated clones effectively. Given the source code, we first perform clone filtering by the inverted index to locate the suspected clones. For each suspected clone, we create the adjacency image based on the adjacency matrix of the normalized abstract syntax tree (AST). Then we design an image encoder to highlight the structural details further and refine pixels of the image. Specifically, we employ the Markov model to encode the adjacency image into a state probability image and remove its useless pixels. By this, the original complex tree can be transformed into a one-dimensional vector while preserving the structural feature of the AST. Finally, we detect clones by calculating the Jaccard Similarity of these vectors. We conduct compa…

Overview

Integrity signals

Registry

Crossref · 10.1109/tse.2023.3295801

Cites

7 of 7 references verified0 citation errors · 0 not checkable

Statistics

Recomputing p-values needs the paper’s full text.

Verification

Claims the paper makes

This paper’s full text isn’t openly available, so its claims and self-check weren’t run. The registry and citation checks still apply.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Citations

Cites

Show all 7 references

Research works printed but not linked: 35

  1. 10.1007/s11432-017-9445-4 · doi:10.1007/s11432-017-9445-4
  2. 10.1145/3180155.3180179 · DOI
  3. 10.1109/ICSME.2017.46 · DOI · Paper page
  4. 10.1109/CSMR.2009.20 · DOI · Paper page
  5. 10.1109/TSE.2002.1019480 · DOI · Paper page
  6. 10.1007/978-981-16-1927-4_2 · DOI
  7. 10.1145/3324884.3416562 · DOI
  8. 10.1145/3236024.3236068 · DOI · Paper page
  9. 10.1109/SANER48275.2020.9054857 · DOI · Paper page
  10. 10.1007/BF00271633 · doi:10.1007/bf00271633
  11. 10.1145/2884781.2884877 · DOI · Paper page
  12. 10.1145/3468264.3468564 · DOI
  13. 10.1109/ACCESS.2020.2971545 · DOI
  14. 10.1007/s10664-019-09697-7 · DOI
  15. 10.1109/COMPSAC.2018.00045 · doi:10.1109/compsac.2018.00045
  16. Roy, 2007, A survey on software clone detection research, Queens School Comput. TR, 541, 64
  17. 10.1109/TSE.2007.70725 · DOI · Paper page
  18. 10.1145/2970276.2970326 · DOI · Paper page
  19. 10.24963/ijcai.2017/423 · DOI · Paper page
  20. 10.1145/3524610.3527896 · DOI
  21. 10.1609/aaai.v30i1.10139 · DOI · Paper page
  22. 10.1109/ISESE.2005.1541846 · DOI
  23. 10.1109/MSR.2017.15 · DOI
  24. 10.1109/WCRE.2012.48 · DOI
  25. 10.1109/IWSC.2017.7880507 · DOI
  26. 10.1109/ICSE-C.2017.78 · DOI
  27. Harris, 2007, Parallel prefix sum (scan) with CUDA, GPU Gems, 3, 851
  28. 10.1145/3236024.3236026 · DOI
  29. 10.1162/neco.1993.5.3.402 · DOI · Paper page
  30. 10.1109/SANER48275.2020.9054832 · DOI
  31. 10.1016/j.jss.2017.11.039 · DOI
  32. 10.1109/ICSM.2011.6080795 · DOI
  33. 10.1109/IWSC.2013.6613037 · DOI
  34. Yutao, TreeCen: Building tree graph for scalable semantic code clone detection, 1
  35. 10.1109/TR.2020.3001918 · DOI

Cited by

Metadata

Authors
Hu, Y., Fang, Y., Sun, Y., Jia, Y., Wu, Y., Zou, D., & Jin, H.
Affiliations
  • Huazhong University of Science and Technology (CN)
  • Nanyang Technological University (SG)
Venue
IEEE Transactions on Software Engineering
Published
2023-09-01
Volume
49
Issue
9
Pages
4429-4442
ISSN
  • 0098-5589 (ISSN-L)
  • 1939-3520
  • 2326-3881
OpenAlex
W4384499126
Cited by
9
References
7
Citations by year
2026: 3 · 2025: 1 · 2024: 5
FWCI
2.11
Type
journal article
Language
en
Open access
closed
Locations
  • IEEE Transactions on Software Engineering (publishedVersion)
  • DR-NTU (Nanyang Technological University) (submittedVersion)
Funders
  • National Natural Science Foundation of China (62172168)
  • Hubei Province Key R&D Technology Special Innovation Project (2021BAA032)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
  • Social Sciences › Education › Academic integrity and plagiarism
Keywords
code clone detection, abstract syntax tree, adjacency matrix, Markov model, Jaccard similarity, inverted index, scalability, source code structure

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.