Abstract:Fault localization is one of the most expensive, tedious, and time-consuming activities in software debugging, and it is also an indispensable step in software maintenance. Due to the variability of faults, fault localization is even more challenging in software product lines. Although significant progress has been made in fault localization for single-system software, research on fault localization for variability in software product lines is still insufficient. Meanwhile, existing methods face challenges such as low efficiency and poor root cause localization due to the issues of repeated generation and checking of feature interactions, as well as the propagation of faults between program statements. To address this, this study proposes an efficient and accurate fault localization method for software product lines, which performs localization at both the feature level and the statement level. At the feature level, based on observations of inclusion relationships and identical subsets between suspicious feature selection sets, the method identifies suspicious feature interactions more efficiently. At the statement level, a reduced causal model with mediator variables is used, combining causal effects and spectrum-based effects to achieve more precise fault localization. Four advanced fault localization methods for software product lines are selected, and experiments are conducted on six real-world software product line systems for comparison. The results demonstrate that the proposed method significantly outperforms other mainstream methods in terms of localization efficiency and accuracy.