Ensuring software quality remains a critical challenge in complex and dynamic development environments, where software defects can result in significant operational and financial risks. This paper proposes an innovative framework for software defect prediction that combines ensemble feature extraction with reinforcement learning (RL)--based feature selection. We claim that this work is among the first in recent efforts to address this challenge at the file-level granularity. The framework extracts diverse semantic and structural features from source code using five code-specific pre-trained models. Feature selection is enhanced through a custom-defined embedding space tailored to represent feature interactions, coupled with a pheromone table mechanism inspired by Ant Colony Optimization (ACO) to guide the RL agent effectively. Using the Proximal Policy Optimization (PPO) algorithm, the proposed method dynamically identifies the most predictive features for defect detection. Experimental evaluations conducted on the PROMISE dataset highlight the framework's superior performance on the F1-Score metric, achieving an average improvement of $6.25\%$ over traditional methods and baseline models across diverse datasets. This study underscores the potential for integrating ensemble learning and RL for adaptive and scalable defect prediction in modern software systems.
翻译:在复杂动态的开发环境中,确保软件质量仍是一项关键挑战,软件缺陷可能导致重大的运营与财务风险。本文提出了一种创新的软件缺陷预测框架,该框架将集成特征提取与基于强化学习的特征选择相结合。我们主张,本研究是近期在文件粒度级别应对此挑战的首批工作之一。该框架利用五个针对代码的预训练模型,从源代码中提取多样化的语义与结构特征。特征选择通过一个专门定义、用于表征特征交互的嵌入空间得到增强,并结合受蚁群优化启发的信息素表机制,以有效引导强化学习智能体。采用近端策略优化算法,所提方法能够动态识别对缺陷检测最具预测性的特征。在PROMISE数据集上进行的实验评估突显了该框架在F1分数指标上的优越性能,相较于传统方法与基线模型,在不同数据集上平均提升了$6.25\%$。本研究强调了集成学习与强化学习相结合在现代软件系统中实现自适应、可扩展缺陷预测的潜力。