Software defect prediction models assist developers in optimizing the allocation of testing resources by pinpointing source code modules that are prone to defects. Abstract Syntax Tree (AST) is widely used in defect prediction due to its ability to capture syntactic rules of source code. However, previous research has three main limitations: numerous AST nodes consuming many resources, AST not explicitly representing semantics, and a lack of fine-grained defect prediction approaches. To alleviate these limitations, we propose MulLog, a novel software defect prediction approach. In short, MulLog models a source code file as a collection of multi-label nodes and a Line Property Graph (LPG). It then employs a combined approach of multi-label contrastive learning and Line Property Graph learning to extract fine-grained syntactic and semantic information at the code line level, thereby identifying defective code lines and files. We conducted extensive experiments on file-level and line-level defect prediction tasks in both cross-project and within-project validation settings. The evaluation results indicate that our approach outperforms the state-of-the-art techniques across 32 versions of 9 software projects.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

MulLog: A Software Defect Prediction Approach Based on Multi-label Contrastive Learning and Line Property Graph Learning

  • Qiong Wu,
  • Ziyang Su,
  • Yuliang Shi,
  • Kaiyuan Qi,
  • Dong Wu,
  • Zhiyong Chen,
  • Hui Li

摘要

Software defect prediction models assist developers in optimizing the allocation of testing resources by pinpointing source code modules that are prone to defects. Abstract Syntax Tree (AST) is widely used in defect prediction due to its ability to capture syntactic rules of source code. However, previous research has three main limitations: numerous AST nodes consuming many resources, AST not explicitly representing semantics, and a lack of fine-grained defect prediction approaches. To alleviate these limitations, we propose MulLog, a novel software defect prediction approach. In short, MulLog models a source code file as a collection of multi-label nodes and a Line Property Graph (LPG). It then employs a combined approach of multi-label contrastive learning and Line Property Graph learning to extract fine-grained syntactic and semantic information at the code line level, thereby identifying defective code lines and files. We conducted extensive experiments on file-level and line-level defect prediction tasks in both cross-project and within-project validation settings. The evaluation results indicate that our approach outperforms the state-of-the-art techniques across 32 versions of 9 software projects.