Stubber: Compiling Source Code into Bytecode without Dependencies for Java Code Clone Detection
André Schäfer, Wolfram Amme, Thomas S. Heinze
Abstract
A lot of clone detection tools for Java have been introduced in recent years. On the one hand, many of these tools work on Java source code and can thus be conveniently evaluated with the state-of-the-art benchmark BigCloneBench and evaluation framework BigCloneEval. On the other hand, certain clone detectors deliberately address the Bytecode and cannot be applied to Java source code. Simple compilation often does not solve the problem due to missing required dependencies, as, e.g., in case of BigCloneBench. In this work, we therefore present the tool STUBBER for compiling Java source code into Bytecode without dependencies. We can show that using Stubber, Bytecode for over 95% of all Java source files and 92.5% of all code clones contained in BigCloneBench can be successfully generated. As a consequence, the evaluation of Bytecode-based clone detectors on BigCloneBench becomes possible and such tools can also be applied to Java source files, even beyond BigCloneBench.