检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:刁旭炀 吴凯 陈都 周俊峰 高璞 DIAO Xuyang;WU Kai;CHEN Du;ZHOU Junfeng;GAO Pu(Shanghai Electro-Mechanical Engineering Institute,Shanghai 201109,China)
出 处:《计算机测量与控制》2023年第3期56-62,70,共8页Computer Measurement &Control
摘 要:软件缺陷预测技术用于定位软件中可能存在缺陷的代码模块,从而辅助开发人员进行测试与修复;传统的软件缺陷特征为基于软件规模、复杂度和语言特点等人工提取的静态度量元信息;然而,静态度量元特征无法直接捕捉程序上下文中的缺陷信息,从而影响了软件缺陷预测的性能;为了充分利用程序上下文中的语法语义信息,论文提出了一种基于混合注意力机制的软件缺陷预测方法 DP-MHA(defect prediction via mixed attention mechanism);DP-MHA首先从程序模块中提取基于AST树的语法语义序列并进行词嵌入编码和位置编码,然后基于多头注意力机制自学习上下文语法语义信息,最后利用全局注意力机制提取关键的语法语义特征,用于构建软件缺陷预测模型并识别存在潜在缺陷的代码模块;为了验证DP-MHA的有效性,论文选取了6个Apache的开源Java数据集,与经典的基于RF的静态度量元方法、基于RBM+RF、DBN+RF无监督学习方法和基于CNN和RNN深度学习方法进行对比,实验结果表明,DP-MHA在F1值分别提升了16.6%、34.3%、26.4%、7.1%、4.9%。Software defect prediction technique is used to locate code module with possible defects in software, which helps developers test and fix bugs. Traditional defect prediction features are manual static code metrics based on software scale, complexity and language characteristic. However, these features cannot directly capture defect information from program context, resulting in the degradation of defect prediction performance. To take full advantage of syntactic and semantic features in program context, a method called Defect Prediction via Mixed Attention Mechanism(DP-MHA) is proposed in this paper. Firstly, DP-MHA first extracts the AST tree-based syntactic and semantic sequence from program modules and performs word embedding and positional encoding. Then the contextual syntax and semantic information is learned by the Multi-head attention mechanism. Finally, the global attention mechanism is used to extract the key syntactic and semantic features, which are used to build a software defect prediction model and identify code snippets with potential defects. In order to verify the effectiveness of DP-MHA, six Apache open-source Java projects are selected to be compared with the state-of-the-art methods including classical static code metric method based on RF, unsupervised learning method based on RBM+RF, DBN+RF and deep learning method based on CNN, RNN. The experimental results show that DP-MHA improves F1-Measure by 16.6%, 34.3%, 26.4%, 7.1% and 4.9%, respectively.
关 键 词:软件缺陷预测 语法语义信息 静态度量元 多头注意力机制 全局注意力机制
分 类 号:TP3[自动化与计算机技术—计算机科学与技术]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.90