MENTOR: Fixing Introductory Programming Assignments With Formula-Based Fault Localization and LLM-Driven Program Repair

Apr 1, 2026ยท
Pedro Orvalho
Pedro Orvalho
,
Mikolรกลก Janota
,
Vasco Manquinho
ยท 0 min read
Image credit: JSS
Abstract
The increasing demand for programming education has led to online evaluations like MOOCs, which rely on introductory programming assignments (IPAs). A major challenge in these courses is providing personalized feedback at scale. This paper introduces MENTOR, a semantic automated program repair (APR) framework designed to fix faulty student programs. MENTOR validates repairs through execution on a test suite, and returns the repaired program or highlights faulty statements. Unlike symbolic repair tools like Clara and Verifix, which require correct implementations with identical control flow graphs (CFGs), MENTORโ€™s LLM-based approach enables flexible repairs without strict structural alignment. MENTOR clusters successful submissions regardless of CFGs, and employs a Graph Neural Network (GNN)-based variable alignment module for enhanced accuracy. Next, MENTORโ€™s fault localization module leverages MaxSAT techniques to pinpoint buggy code segments precisely. Finally, MENTORโ€™s program fixer integrates Formal Methods (FM) and Large Language Models (LLMs) through a Counterexample Guided Inductive Synthesis (CEGIS) loop, iteratively refining repairs. Experimental results show that MENTOR significantly improves repair success rates, achieving 64.4%, far surpassing Verifix (6.3%) and Clara (34.6%). By merging formula-based fault localization, and LLM-driven repair, MENTOR provides an innovative, scalable framework for programming education.
Type
Publication
In the Journal of Systems and Software (JSS) 2026 [SJR Q1 Journal].