A Code Difference Extraction Method Based on Node Feature Enhancement
The analysis and understanding of source code changes play a crucial role in software maintenance, especially in tasks such as code review, software merging, and regression testing. Traditional text-based code difference extraction methods, such as git diff, typically only recognize insertions and deletions, neglecting the syntactic structure, which makes it difficult to effectively identify updates or movements. To address this issue, tree-based methods leverage the abstract syntax tree (AST) of the source code to generate fine-grained code differences, allowing for more accurate capture of structural changes in the code. However, existing difference extraction methods often overlook the semantic features of nodes, making it difficult to precisely identify node movements and updates. This paper proposes a code difference extraction method based on node feature enhancement, which introduces a node feature enhancement module and uses a neural network-based graph matching algorithm for node mapping. Experimental results show that the proposed method significantly improves both the accuracy and efficiency of code difference extraction.
Authors
- Rongcheng Duan
- Ke Wang (ORCID: https://orcid.org/0009-0008-4869-5135)
- Zhang Ren (ORCID: https://orcid.org/0000-0002-6109-4085)
- Lu Li (ORCID: https://orcid.org/0000-0002-2633-7942)
Institutions
- Xidian University (CN)
Publication Details
- Published
- 2024-12-27
- DOI
- https://doi.org/10.1109/auteee62881.2024.10869796
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00