We present FixLocator, a novel DL-based FL approach that aims to locate co-change fixing locations within one or multiple methods. Our empirical results show that FixLocator outperforms the studied DL-based FL baselines, advancing FL in dealing with multiple CC fixing statements.
ABSTRACT
We present FixLocator, a DL-based fault localization (FL) approach supporting the detection of faulty statements in one or multiple methods that need to be modified accordingly in the same fix. Let us call them co-change (CC) fixing locations for a fault. We treat this FL problem as a dual learning task with two models. First, the method-level FL model, MethFL, learns the methods to be fixed together. Second, the statement-level FL model, StmtFL, learns the statements to be co-fixed. Correct learning in a model can benefit the other and vice versa. Exploring this duality provides useful constraints for FixLocator to learn derive CC fixing statements. Thus, we simultaneously train them with soft-sharing the models’ parameters via cross-stitch units to exploit this duality. In a cross-stitch unit, the sharing of representations between MethFL and StmtFL is modeled by the learning a linear combination of the input features from two models. The cross-stitch units enable the propagation of the impact of method-level FL on statement-level FL and vice versa. In addition to the new dual learning model solution, we also explore a novel feature, which is the co-change information among statements. We use Graph-based Convolution Network to integrate different types of program dependencies among the statements. Our empirical evaluation on real-world datasets shows that FixLocator relatively improves over the state-of-the-art statement-level FL baselines by locating more CC fixing statements from 26.5% to 155.6%, and reduces the statements to be examined by 22%–30%.