SupConFL: Fault Localization with Supervised Contrastive Learning

  • Wei Chen
  • , Wu Chen*
  • , Jiamou Liu
  • , Kaiqi Zhao
  • , Mingyue Zhang
  • *Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Recent years have seen a growing interest in deep learning-based approaches to localize faults in software. However, existing methods have not reached a satisfying level of accuracy. The main reason is that the feature extraction of faulty code elements is insufficient. Namely, these deep learning-based methods will learn some features that are not relevant to fault localization, and thus ignore the features related to fault localization. We propose SupConFL, a new framework for statement-level fault localization. Our framework combines the statement-level abstract syntax tree with the statement sequence, and adopt controllable attention-based LSTM to locate the faulty elements. The training is done through contrastive learning between the faulty code and its fixed version. By comparing the faulty code with the fixed code, the model can learn richer features of the faulty code elements. Our experiments on Defects4j-1.2.0 dataset show that our method outperforms the current state-of-the-art. Specifically, SupConFL improves Top-1 score by 7.96% in comparison with the current state-of-the-art. In addition, our method has also achieved good results in cross-project experiments.

Original languageEnglish
Title of host publication14th Asia-Pacific Symposium on Internetware, Internetware 2023 - Proceedings
PublisherAssociation for Computing Machinery
Pages44-54
Number of pages11
ISBN (Electronic)9798400708947
DOIs
StatePublished - 4 Aug 2023
Externally publishedYes
Event14th Asia-Pacific Symposium on Internetware, Internetware 2023 - Hangzhou, China
Duration: 4 Aug 20236 Aug 2023

Publication series

NameACM International Conference Proceeding Series

Conference

Conference14th Asia-Pacific Symposium on Internetware, Internetware 2023
Country/TerritoryChina
CityHangzhou
Period4/08/236/08/23

Keywords

  • code representation
  • contrastive learning
  • fault localization

Fingerprint

Dive into the research topics of 'SupConFL: Fault Localization with Supervised Contrastive Learning'. Together they form a unique fingerprint.

Cite this