Finding Source Code Clones in Intermediate Representations of Java Bytecode

André Schäfer, Thomas S. Heinze, Wolfram Amme · 2023

Copied, reused and modified program code is a common phenomena in software development. As the resulting code clones are often not labeled as such and their proper detection is crucial to software quality and re-engineering, numerous techniques and tools for finding code clones have been developed. This as well applies to the Java programming language, though most clone detectors work on Java source code. Only some research addresses code clones in Java Bytecode and an even smaller fraction investigates the relationship between Java source code and Bytecode code clones. In this paper, we extend the source-code based clone detector StoneDetector to Java Bytecode. Using BigCloneBench as state-of-the-art benchmark, we are able to assess and analyze its effectiveness in detecting source code clones in Java Bytecode. We also report on differences in the performance of clone detection for stack-based and register-based representations of Java Bytecode. The results show that, while code clones found in Java source code and Bytecode in general can differ, source code clones can be detected in Java Bytecode with high recall and precision using the presented system.

Read the paper · More papers on PaperTik