Collaborative Analysis on Code Structure and Semantics

Published: 01 Jan 2022, Last Modified: 22 May 2025ChineseCSCW (2) 2022EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: In this paper, we propose the collaborative method that analyzes both code structure and function semantics for code comparison. First, we create the function call graph of code and use it to obtain the structure semantics with the graph auto-encoder. Then the function semantics are obtained with the names and definition of the used library functions and built-in classes in code. Finally, we integrate the structure and function semantics to collaboratively analyze the similarity of codes. We adopt several real code datasets to validate our method and the experimental results show that it outperforms other baselines. The ablation experiments show that the function call structure contributes the most to the performance. We also visualize the semantics of function structures to illustrate that the proposed method can extract the correlations and differences between codes.
Loading