bjCnet: A contrastive learning-based framework for software defect prediction

J Han, C Huang, J Liu - Computers & Security, 2024 - Elsevier
J Han, C Huang, J Liu
Computers & Security, 2024Elsevier
Defect prediction based on deep learning is proposed to provide practitioners with reliable
and practical tools to determine whether an area of code is defective. Compared with
traditional code features, semantic features of source codes automatically extracted by
neural networks can better reflect the semantic differences between codes. However, the
small difference between some bug codes and clean codes poses a challenge for deep
learning models in distinguishing them, leading to a low accuracy in defect prediction. In this …
Abstract
Defect prediction based on deep learning is proposed to provide practitioners with reliable and practical tools to determine whether an area of code is defective. Compared with traditional code features, semantic features of source codes automatically extracted by neural networks can better reflect the semantic differences between codes. However, the small difference between some bug codes and clean codes poses a challenge for deep learning models in distinguishing them, leading to a low accuracy in defect prediction. In this paper, we propose bjCnet, a software defect prediction framework based on contrastive learning. It fine-tunes the pre-trained Transformer-based code large language model via a supervised contrastive learning network, achieving accurate defect prediction. We evaluate the prediction effect of bjCnet, the results demonstrate that the highest accuracy and f1-score achieved by bjCnet are both 0.948, surpassing the performance of the state-of-the-art approaches selected for comparison.
Elsevier
Showing the best result for this search. See all results