Fault Localization for Novice Programs Combining Static Analysis and Dynamic Detection

Han Wan, Wenhao Nie, Shiyang Yue, Xiaoyan Luo · 2024

In programming teaching, teachers or teaching assistants often need to spend a lot of energy helping students solve the problems they face when doing programming. It will be helpful to provide students with valuable programming feedback, such as information on faulty lines. However, most existing algorithms do not perform well on novice programs. Therefore, considering the background in programming teaching, we proposed a novel approach combining static analysis with dynamic detection by using the correct programs submitted by previous students and coverage information for the incorrect program. In particular, the core of the static analysis module is to locate specific faulty lines through syntax tree difference comparison, which includes matching similar programs, variable mapping and replacement, and fault localization based on abstract syntax tree differences. The core of the module on dynamic detection is to perform traditional Spectrum-based Fault Localization. To evaluate the effectiveness of our proposed approach, we conducted some empirical studies on 223 student-failure programs in the real world. The experimental results indicate that our approach outperforms other baselines regarding TOP-l and TOP-3. Furthermore, we analyzed the performance of our method on different categories of programming problems as well as the effectiveness of the combination of static analysis and dynamic detection.

Read the paper · More papers on PaperTik