Spectrum-Based Fault Localization for Context-Free Grammars
We describe and evaluate the first spectrum-based fault localization method aimed at finding faulty rules in a context-free grammar. It takes as input a test suite and a modified parser for the grammar that can collect grammar spectra, i.e., the sets of rules used in attempts to parse the individual test cases, and returns as output a ranked list of suspicious rules. We show how grammar spectra can be collected for both LL and LR parsers, and how the ANTLR and CUP parser generators can be modified and used to automate the collection of the grammar spectra. We evaluate our method over grammars with seeded faults as well as real world grammars and student grammars submitted in compiler engineering courses that contain real faults. The results show that our method ranks the seeded faults within the top five rules in more than half of the cases and can pinpoint it in 10%-40% of the cases. On average, it ranks the fault at around 25% of all rules, with results of better than 15% for a very large test suite. It also allowed us to identify deviations and faults in the real world and student grammars.
Mon 21 Oct
|11:00 - 11:30|
|11:30 - 12:00|
|12:00 - 12:30|