TY - GEN
T1 - Towards Overcoming Type Limitations in Semantic Clone Detection
AU - Leone, Francesco
AU - Takada, Shingo
N1 - Funding Information:
This research was partially supported by JSPS KAKENHI grant number 20K11758.
Publisher Copyright:
© 2022 IEEE.
PY - 2022
Y1 - 2022
N2 - Currently available tools for semantic clone detection have serious type limitations related to objects, in particular related to instantiation and comparison. The trend in the recent research has focused on improving the performance rather than removing these constraints. This paper proposes a test-based approach for semantic clone detection in Java which overcomes these problems. The test-based approach consists in running two methods with the same input and comparing their outputs. For object instantiation, the approach uses EvoSuite, an automatic JUnit test generator, to create the tests with correct instantiations of all the needed classes, which are then modified to make them suitable for semantic clone detection. The output comparison uses the DeepHash function to obtain numerical values for objects, considering the values of each instance variable. The approach was evaluated with SemanticCloneBench. The results show that the proposed approach performs very well in terms of precision, achieving 94.4%, which is about 8% higher than the reported precision of SLACC, a recent semantic clone detector. Furthermore, out of 228 methods used for the evaluation, the approach was not able to perform the detection for only ten methods.
AB - Currently available tools for semantic clone detection have serious type limitations related to objects, in particular related to instantiation and comparison. The trend in the recent research has focused on improving the performance rather than removing these constraints. This paper proposes a test-based approach for semantic clone detection in Java which overcomes these problems. The test-based approach consists in running two methods with the same input and comparing their outputs. For object instantiation, the approach uses EvoSuite, an automatic JUnit test generator, to create the tests with correct instantiations of all the needed classes, which are then modified to make them suitable for semantic clone detection. The output comparison uses the DeepHash function to obtain numerical values for objects, considering the values of each instance variable. The approach was evaluated with SemanticCloneBench. The results show that the proposed approach performs very well in terms of precision, achieving 94.4%, which is about 8% higher than the reported precision of SLACC, a recent semantic clone detector. Furthermore, out of 228 methods used for the evaluation, the approach was not able to perform the detection for only ten methods.
KW - output comparison
KW - semantic code clones
KW - test generation
KW - type limitation
UR - http://www.scopus.com/inward/record.url?scp=85145771926&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85145771926&partnerID=8YFLogxK
U2 - 10.1109/IWSC55060.2022.00013
DO - 10.1109/IWSC55060.2022.00013
M3 - Conference contribution
AN - SCOPUS:85145771926
T3 - Proceedings - 2022 IEEE 16th International Workshop on Software Clones, IWSC 2022
SP - 25
EP - 31
BT - Proceedings - 2022 IEEE 16th International Workshop on Software Clones, IWSC 2022
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 16th IEEE International Workshop on Software Clones, IWSC 2022
Y2 - 2 October 2022 through 7 October 2022
ER -