Netinfo Security ›› 2026, Vol. 26 ›› Issue (7): 1012-1027.doi: 10.3969/j.issn.1671-1122.2026.07.002

Previous Articles     Next Articles

Software defect prediction method based on multi-view pruning and optimized random forest

Zhang Dawei1,2, Zhou Yang1(), Du Ye1,2, Tang Yu1   

  1. 1School of Cyberspace Science and Technology, Beijing Jiaotong University, Beijing100044, China
    2Tangshan Research Institute of Beijing Jiaotong University, Tangshan 063000, China
  • Received:2026-01-26 Online:2026-07-10 Published:2026-09-03
  • Contact: Zhou Yang E-mail:2521664181@qq.com

Abstract:

Aiming at the problems that traditional random forests applied in the field of software defect prediction suffer from high structural redundancy, poor interpretability, and limited prediction performance caused by the separation of parameter optimization and structural pruning, this paper proposed an optimized random forest model (POMRF) integrating a multi-view structural redundancy pruning mechanism (MSRP) and an improved sparrow search algorithm (SCSSA). Firstly, a multi-view redundancy evaluation system was constructed, which fused semantic similarity and structural distance through feature usage vectors and weighted structural vectors to accurately identify and eliminate redundant decision trees; Secondly, the Sparrow Search Algorithm was improved by introducing a sine cooperative update mechanism and a hybrid mutation strategy to optimize the core parameters of the random forest, thereby enhancing the global optimization capability and robustness of the algorithm; Finally, the POMRF model was applied to software defect prediction tasks, and experimental verification was carried out on 6 public software defect datasets in comparison with various state-of-the-art algorithms. The experimental results show that the POMRF model outperforms other comparison algorithms in multiple evaluation metrics. It not only effectively solves the problem of inaccurate single-view redundancy evaluation of traditional methods, improves the interpretability and structural compactness of the model, but also breaks through the limitation of the separation between parameter optimization and pruning through their collaborative linkage, significantly enhancing the prediction accuracy and stability. This model provide an efficient and reliable solution that balanced accuracy and interpretability for the field of software defect prediction.

Key words: random forest, structural pruning, multi-view redundancy, interpretability enhancement

CLC Number: