Regression testing aims to confirm that program changes don't disrupt existing functionalities. Automated fault localization improves quality and efficiency of regression testing. Spectrum-Based Fault Localization (SBFL) is adept at identifying faults in program statements using test case execution data. However, SBFL overlooks faults due to structural anomalies and can't detect non-existent or redundant statements.
This study introduces Program Structure Check (PSC) to address the issue. In regression testing, historical program versions provide valuable information for fault localization. PSC compares the structure of the program being tested with programs of historical versions to find structural differences, like missing code. This increases suspicion scores at these locations. Experimental findings show PSC detects over 90% of structural bugs, with over 76% ranked highest on the suspicion list.
We combine PSC with SBFL, termed PSC-SBFL, and test it on public assemblies to assess bug location effects. Results indicate that adding PSC to SBFL enhances bug ranking by approximately 93% and reduces manual code checking by about 34% when all bugs are identified. Compared to another SBFL-based method, PSC-SBFL demonstrates superior bug localization. These findings underscore how combining PSC and SBFL algorithms enhances bug localization accuracy, expedites bug identification, and boosts software quality.