一句话:提出 Refactory,用重构正确解并匹配控制流、合成补丁,为错误学生程序实时生成修复。
本文面向编程作业反馈生成,解决现有自动修复方法依赖人工错误模型、需要大量正确提交、且扩展性与准确性不足的问题。方法名为 Refactory:先把所有正确解重构为语义等价的变体;对错误程序按控制流结构匹配最接近的重构程序;再从正确程序对齐基本块的执行中推断错误程序基本块的输入-输出规约;最后用基于搜索的合成修改错误块。作者在大型公立大学入门课程约1800份、来自361名学生的真实错误Python提交上评估,并与Clara等最新方法比较。结果显示,约30%的补丁比Clara更小,且常只需单个正确解、耗时更短。作者认为该方法也可作为仅需一个正确参考解的通用程序修复方法。
Automated program repair has been used to provide feedback for incorrect student programming assignments, since program repair captures the code modification needed to make a given buggy program pass a given test-suite. Existing student feedback generation techniques are limited because they either require manual effort in the form of providing an error model, or require a large number of correct student submissions to learn from, or suffer from lack of scalability and accuracy. In this work, we propose a fully automated approach for generating student program repairs in real-time. This is achieved by first re-factoring all available correct solutions to semantically equivalent solutions. Given an incorrect program, we match the program with the closest matching refactored program based on its control flow structure. Subsequently, we infer the input-output specifications of the incorrect program's basic blocks from the executions of the correct program's aligned basic blocks. Finally, these specifications are used to modify the blocks of the incorrect program via search-based synthesis. Our dataset consists of almost 1,800 real-life incorrect Python program submissions from 361 students for an introductory programming course at a large public university. Our experimental results suggest that our method is more effective and efficient than recently proposed feedback generation approaches. About 30% of the patches produced by our tool Refactory are smaller than those produced by the state-of-art tool Clara, and can be produced given fewer correct solutions (often a single correct solution) and in a shorter time. We opine that our method is applicable not only to programming assignments, and could be seen as a general-purpose program repair method that can achieve good results with just a single correct reference solution.
@inproceedings{paperbot5187,
title = {Re-Factoring Based Program Repair Applied to Programming Assignments},
author = {Yang Hu and Umair Z. Ahmed and Sergey Mechtaev and Ben Leong and Abhik Roychoudhury},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00044}
}