Detecting Java Code Clones Based on Bytecode Sequence Alignment

When the source code is copied and pasted or modified, there will be a lot of identical or similar code snippets in the software system, which are called code clones. Because code clones are believed to result in undesirable maintainability of software, numerous approaches and techniques have been p...

Full description

Bibliographic Details
Main Authors: Dongjin Yu, Jiazha Yang, Xin Chen, Jie Chen
Format: Article
Language:English
Published: IEEE 2019-01-01
Series:IEEE Access
Subjects:
Online Access:https://ieeexplore.ieee.org/document/8637956/
id doaj-2d0e5922688f4ac3b9965333ffae2f9e
record_format Article
spelling doaj-2d0e5922688f4ac3b9965333ffae2f9e2021-03-29T22:04:46ZengIEEEIEEE Access2169-35362019-01-017224212243310.1109/ACCESS.2019.28984118637956Detecting Java Code Clones Based on Bytecode Sequence AlignmentDongjin Yu0https://orcid.org/0000-0001-8919-1613Jiazha Yang1Xin Chen2Jie Chen3School of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, ChinaSchool of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, ChinaSchool of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, ChinaSchool of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou, ChinaWhen the source code is copied and pasted or modified, there will be a lot of identical or similar code snippets in the software system, which are called code clones. Because code clones are believed to result in undesirable maintainability of software, numerous approaches and techniques have been proposed for code clone detection. However, most of them are based on the source code, while only a few employ the bytecode to detect code clones. In this paper, we introduce an approach based on Java bytecode, which mainly contains the steps of bytecode sequence alignment and similarity score comparison. In particular, we apply the Smith-Waterman algorithm to align bytecode sequences for precise matching. Moreover, we separately consider the similarities between instruction sequences and method call sequences, thus improving its effectiveness in detecting code clones. We conducted an extensive experiment on five open-source software to evaluate the proposed approach. The results show that our approach outperforms other state-of-the-art techniques.https://ieeexplore.ieee.org/document/8637956/Code clonescode clone detectionJava bytecodecode sequence alignmentcode similaritiesinstruction block
collection DOAJ
language English
format Article
sources DOAJ
author Dongjin Yu
Jiazha Yang
Xin Chen
Jie Chen
spellingShingle Dongjin Yu
Jiazha Yang
Xin Chen
Jie Chen
Detecting Java Code Clones Based on Bytecode Sequence Alignment
IEEE Access
Code clones
code clone detection
Java bytecode
code sequence alignment
code similarities
instruction block
author_facet Dongjin Yu
Jiazha Yang
Xin Chen
Jie Chen
author_sort Dongjin Yu
title Detecting Java Code Clones Based on Bytecode Sequence Alignment
title_short Detecting Java Code Clones Based on Bytecode Sequence Alignment
title_full Detecting Java Code Clones Based on Bytecode Sequence Alignment
title_fullStr Detecting Java Code Clones Based on Bytecode Sequence Alignment
title_full_unstemmed Detecting Java Code Clones Based on Bytecode Sequence Alignment
title_sort detecting java code clones based on bytecode sequence alignment
publisher IEEE
series IEEE Access
issn 2169-3536
publishDate 2019-01-01
description When the source code is copied and pasted or modified, there will be a lot of identical or similar code snippets in the software system, which are called code clones. Because code clones are believed to result in undesirable maintainability of software, numerous approaches and techniques have been proposed for code clone detection. However, most of them are based on the source code, while only a few employ the bytecode to detect code clones. In this paper, we introduce an approach based on Java bytecode, which mainly contains the steps of bytecode sequence alignment and similarity score comparison. In particular, we apply the Smith-Waterman algorithm to align bytecode sequences for precise matching. Moreover, we separately consider the similarities between instruction sequences and method call sequences, thus improving its effectiveness in detecting code clones. We conducted an extensive experiment on five open-source software to evaluate the proposed approach. The results show that our approach outperforms other state-of-the-art techniques.
topic Code clones
code clone detection
Java bytecode
code sequence alignment
code similarities
instruction block
url https://ieeexplore.ieee.org/document/8637956/
work_keys_str_mv AT dongjinyu detectingjavacodeclonesbasedonbytecodesequencealignment
AT jiazhayang detectingjavacodeclonesbasedonbytecodesequencealignment
AT xinchen detectingjavacodeclonesbasedonbytecodesequencealignment
AT jiechen detectingjavacodeclonesbasedonbytecodesequencealignment
_version_ 1724192256257163264