首页|基于细粒度代码表示和特征融合的即时软件缺陷预测方法

基于细粒度代码表示和特征融合的即时软件缺陷预测方法

扫码查看
即时软件缺陷预测指在软件更改初次提交之际预测该更改引入缺陷的倾向.此类预测针对单一程序变更,而非在粗粒度上进行.由于其即时性和可追溯性,该技术已在持续测试等领域得到广泛应用.目前的研究中,提取变更代码表示的方法粒度较粗,仅标出了变更行,而没有进行细粒度的标记.此外,现有的使用提交内容进行缺陷预测的方法,仅仅是把提交消息与变更代码的特征进行简单拼接,缺失了在特征空间上的深度对齐,这使得在提交消息质量参差不齐的情况下,会出现预测结果易受噪声干扰的情形,并且现有方法也未将领域专家设计的人工特征以及变更内容中的语义语法信息综合起来进行预测.为了解决上述问题,提出了一种基于细粒度代码表征和特征融合的即时软件缺陷预测方法.通过引入新的变更嵌入计算方法来在细粒度上表示变更代码.同时,引入特征对齐模块,降低提交消息中噪声对方法性能的影响.此外,使用神经网络从人工设计的特征中学习专业知识,充分利用现有特征进行预测.实验结果表明,相较于现有方法,该方法在3个性能指标上均有显著提升.
Just-In-Time Software Defect Prediction Approach Based on Fine-grained Code Representation and Feature Fusion
Just-in-time software defect prediction(JIT-SDP)aims to predict the defect tendency of software changes at the time when they are first committed.Such predictions are made on a single program change rather than on a coarse granularity.It has been widely used in fields such as continuous testing due to its immediacy and traceability.Existing JIT-SDP studies extract fea-tures from code changes at a coarse granularity,merely marking the changed lines without fine-grained tagging.Moreover,studies based on commit content are limited to simple concatenation of features extracted from commit messages and code changes,lac-king deep alignment in feature space.This makes the prediction results tend to be disturbed by noise when the quality of commit-ted message cannot be guaranteed.Existing methods also fail to fully utilize artificial features designed by domain experts and se-mantic syntax structure information in commit content at the same time,thus not fully leveraging existing features.To address these problems,a JIT-SDP approach based on fine-grained code changes and feature fusion is proposed.The method introduces new change embeddings to represent code changes at a fine granularity.By designing a feature alignment module,the impact of noise in low-quality commit message on performance is reduced.Meanwhile,neural networks are used to learn domain-specific knowledge from artificial features and fully utilize existing features.Experimental results show that compared to existing me-thods,this approach improves significantly on three performance metrics.

Just-in-time software defect predictionFeature fusionSoftware engineeringDeep learningCode representation

朱晓燕、王文格、王嘉寅、张选平

展开 >

西安交通大学计算机科学与技术学院 西安 710049

即时软件缺陷预测 特征融合 软件工程 深度学习 代码表示

2025

计算机科学
重庆西南信息有限公司(原科技部西南信息中心)

计算机科学

北大核心
影响因子:0.944
ISSN:1002-137X
年,卷(期):2025.52(1)