Skip to main navigation Skip to search Skip to main content

Semantic feature learning for software defect prediction from source code and external knowledge

  • Jingyu Liu
  • , Jun Ai*
  • , Minyan Lu
  • , Jie Wang
  • , Haoxiang Shi
  • *Corresponding author for this work
  • Beihang University

Research output: Contribution to journal › Article › peer-review

Abstract

Software defects not only reduce operational reliability but also significantly increase overall maintenance costs. Consequently, it is necessary to predict software defects at an early stage. Existing software defect prediction studies work with artificially designed metrics or features extracted from source code by machine learning-based approaches to perform classification. However, these methods fail to make full use of the defect-related information other than code, such as comments in codes and commit messages. Therefore, in this paper, additional information extracted from natural language text is combined with the programming language codes to enrich the semantic features. A novel model based on Transformer architecture and multi-channel CNN, PM2-CNN, is proposed for software defect prediction. Pretrained language model and CNN-based classifier are utilized in the model to obtain context-sensitive representations and capture the local correlation of sequences. A large and widely used dataset is utilized to verify the effectiveness of the proposed method. The results show that the proposed method has improvements in generic evaluation metrics compared with the optimal baseline method. Accordingly, external information can have a positive impact on software defect prediction, and our model effectively incorporates such information to improve detection performance.

Original languageEnglish
Article number111753
JournalJournal of Systems and Software
Volume204
DOIs
Publication statusPublished - Oct 2023
Externally publishedYes

Keywords

  • Semantic features
  • Software defect prediction
  • Transformer

Fingerprint

Dive into the research topics of 'Semantic feature learning for software defect prediction from source code and external knowledge'. Together they form a unique fingerprint.

Cite this