首页|基于动态AST与GCN的代码变更影响范围分析

基于动态AST与GCN的代码变更影响范围分析

扫码查看
识别代码变更在程序中的影响范围对确保软件正确性、安全性、可靠性至关重要.代码变更影响分析主要基于代码间的依赖关系识别受影响部分,对受影响部分的权重分析较少涉及.作者提出了一种基于DAST与GCN的代码变更影响范围分析方法.首先扩展了 DAST的相关内容以记录代码变更的相关信息,然后提出了基于DAST的代码依赖分析类型及方法,在构建DAST节点权重矩阵后,使用基于GCN的代码变更影响范围分析模型,以确定代码的变更影响范围.实验结果表明,通过对DAST中的token信息进行扩展可建立代码依赖关系分析的基础;DAST节点权重矩阵与注意力机制相结合,并采用两层GCN,能够得到较好的代码变更影响分析结果.
Analysis of the Impact Scope of Code Changes Based on DAST and GCN
Identifying the impact scope of code changes in a program is crucial for ensuring the correctness,secu-rity,and reliability of software.Code change impact analysis primarily focuses on recognizing the affected parts based on inter-code dependencies,with less involvement in the weight analysis of the affected sections.This pa-per proposes a method for analyzing the impact scope of code changes based on DAST and GCN.Firstly,this pa-per expands the content of DAST to record relevant information related to code changes.Then the code dependen-cy analysis types and methods based on DAST are proposed.After constructing the DAST node weight matrix,the impact scope of code changes based on GCN is used to determine the impact range of code changes.Experimental results show that the foundation for code dependency analysis can be established by expanding the token informa-tion in DAST.After combining the DAST node weight matrix with attention mechanisms,better results in code change impact analysis can be yielded using a 2-layer GCN.

code changesimpact scope analysisDASTGCNnode weight matrixattention mechanism

姜瑛、黄培凤、顾加伟

展开 >

昆明理工大学云南省人工智能重点实验室,云南昆明 650500

昆明理工大学信息工程与自动化学院,云南昆明 650500

代码变更 影响范围分析 DAST GCN 节点权重矩阵 注意力机制

国家自然科学基金项目国家重点研发计划项目

621620382018YFB1003904

2024

昆明理工大学学报(自然科学版)
昆明理工大学

昆明理工大学学报(自然科学版)

CSTPCD北大核心
影响因子:0.516
ISSN:1007-855X
年,卷(期):2024.49(4)