BRAFAR: Bidirectional Refactoring, Alignment, Fault Localization, and Repair for Programming Assignments
Linna Xie, Chongmin Li, Yu Pei, Tian Zhang, Minxue Pan
Abstract
The problem of automated feedback generation for introductory programming assignments (IPAs) has attracted significant attention with the increasing demand for programming education. While existing approaches, like Refactory, that employ the "block-by-block" repair strategy have produced promising results, they suffer from two limitations. First, Refactory randomly applies refactoring and mutation operations to correct and buggy programs, respectively, to align their control-flow structures (CFSs), which, however, has a relatively low success rate and often complicates the original repairing tasks. Second, Refactory generates repairs for each basic block of the buggy program when its semantics differs from the counterpart in the correct program, which, however, ignores the different roles that basic blocks play in the programs and often produces unnecessary repairs. To overcome these limitations, we propose the Brafar approach to feedback generation for IPAs. The core innovation of Brafar lies in its novel bidirectional refactoring algorithm and coarse-to-fine fault localization. The former aligns the CFSs of buggy and correct programs by applying semantics-preserving refactoring operations to both programs in a guided manner, while the latter identifies basic blocks that truly need repairs based on the semantics of their enclosing statements and themselves. In our experimental evaluation on 1783 real-life incorrect student submissions from a publicly available dataset, Brafar significantly outperformed Refactory and Clara, generating correct repairs for more incorrect programs with smaller patch sizes in a shorter time. CCS CONCEPTS • Social and professional topics → Computing education; • Theory of computation → Program analysis.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext c26805be-d0a1-46c0-97d2-d2d52c98443bBuilds on3
- PyDex: Repairing Bugs in Introductory Python Assignments using LLMsJialu Zhang, José Pablo Cambronero, Sumit Gulwani, Vu Le et al.OOPSLA 2024 · 38 citations
- Context-aware and data-driven feedback generation for programming assignmentsDowon Song, Woosuk Lee, Hakjoo OhFSE 2021 · 22 citations
- Concept-Based Automated Grading of CS-1 Programming AssignmentsZhiyu Fan, Shin Hwei Tan, Abhik RoychoudhuryISSTA 2023 · 5 citations
Related papers
- Counterexample Guided Program Repair Using Zero-Shot Learning and MaxSAT-based Fault LocalizationPedro Orvalho, Mikolás Janota, Vasco M. ManquinhoAAAI 2025 · 4 citations
- FastFixer: An Efficient and Effective Approach for Repairing Programming AssignmentsFang Liu, Zhenwei Liu, Qianhui Zhao, Jing Jiang et al.ASE 2024 · 4 citations
- ErrorCLR: Semantic Error Classification, Localization and Repair for Introductory Programming AssignmentsSiqi Han, Yu Wang, Xuesong LuSIGIR 2023 · 9 citations
- RePurr: Automated Repair of Block-Based Learners' ProgramsSebastian Schweikl, Gordon FraserFSE 2025
- Automated Repair of Programs from Large Language ModelsZhiyu Fan, Xiang Gao, Martin Mirchev, Abhik Roychoudhury et al.ICSE 2023 · 213 citations
