TS-FL: Software Fault Localization Based on Teacher-Student Network

Jiale Zhang, Lei Yue, Liwei Zheng, Zhanqi Cui · 2024

Automated fault localization methods can expedite the process for developers to locate faulty code in complex software systems. Existing fault localization methods improve performance by combining the suspicious scores from different kinds of fault localization methods. Among these, the suspicious scores of mutation-based fault localization methods, commonly referred as mutation features, have been proven to effectively enhance fault localization performance. However, collecting mutation features requires generating a large number of mutants and executing test cases for each mutant, which demands sub-stantial computational resources and time. Additionally, certain code statements lack mutation features because no mutant can be generated for them, which affect the performance of fault localization. To address this, this paper proposes a Teacher and Student network-based Fault Lecalization (TS-FL) method. Firstly, a BiLSTM-based classifier is used to extract the deep semantic features of code statements, and the suspicious scores calculated by spectrum-based and mutation-based fault localization methods are used as the spectrum features and mutation features of the code statements, respectively. Then, a teacher-student network is constructed, and a mutual learning strategy is used to collaboratively train the teacher and student network, enabling the student network to learn the mutation feature information from the teacher network and thereby enhance its fault localization performance. The experimental results on Defects4J show that, without using mutation features, TS-FL can locate 36, 36, and 35 more faulty statements than spectrum-based fault localization methods Ochiai, Tarantula, and DStar, and can locate 8 more faulty statements than deep learning-based fault localization method TRANSFER-FL, in terms of Top-1.

Read the paper · More papers on PaperTik