FAPR:编程入门课程的快速准确程序修复
FAPR: Fast and Accurate Program Repair for Introductory Programming Courses
摘要:
在编程入门课程中,教师对学生的错误程序提供调试反馈是一项挑战。最近的一些工具通过识别错误程序和正确程序之间的任何差异来自动提供程序修复反馈,但存在与可扩展性,准确性和跨语言可移植性相关的问题。本文介绍了FAPR -我们的新方法,建议修复程序的差异,在一个快速,准确的方式。FAPR在三个方面不同于当前的工具。首先,它将语法信息编码为令牌序列,以实现错误和正确程序之间的高速比较。其次,为了准确地提取程序差异,FAPR采用了一种新的匹配算法,最大限度地提高令牌级匹配,最小化语句级差异。第三,FAPR依赖于测试而不是静态/动态分析来验证和细化候选修复,因此它消除了由复杂程序分析引起的语言依赖性或高运行时开销。我们实现了FAPR,为C和C++程序提供修复建议;我们的经验表明FAPR具有出色的跨语言可移植性。更重要的是,我们经验比较FAPR与最先进的工具克拉拉。FAPR建议对95.5%以上的错误解决方案进行修复。我们在FAPR的建议中抽取了250个维修样本,发现89.6%的样本是最小的和正确的。FAPR的表现优于Clara,因为它为更多的案例提供了修复建议,创建了更小的修复,产生了更高质量的修复,并降低了运行时开销。我们的研究结果表明,FAPR可以潜在地帮助教师或TA有效地定位错误的代码中的错误,并提供调试提示/指导方针的基础上产生的修复。
英文摘要:
In introductory programming courses, it is challenging for instructors to provide debugging feedback on students' incorrect programs. Some recent tools automatically offer program repair feedback by identifying any differences between incorrect and correct programs, but suffer from issues related to scalability, accuracy, and cross-language portability. This paper presents FAPR -- our novel approach that suggests repairs based on program differences in a fast and accurate manner. FAPR is different from current tools in three aspects. First, it encodes syntactic information into token sequences to enable high-speed comparison between incorrect and correct programs. Second, to accurately extract program differences, FAPR adopts a novel matching algorithm that maximizes token-level matches and minimizes statement-level differences. Third, FAPR relies on testing instead of static/dynamic analysis to validate and refine candidate repairs, so it eliminates the language dependency or high runtime overhead incurred by complex program analysis. We implemented FAPR to suggest repairs for both C and C++ programs; our experience shows the great cross-language portability of FAPR. More importantly, we empirically compared FAPR with a state-of-the-art tool Clara. FAPR suggested repairs for over 95.5% of incorrect solutions. We sampled 250 repairs among FAPR's suggestions, and found 89.6% of the samples to be minimal and correct. FAPR outperformed Clara by suggesting repairs for more cases, creating smaller repairs, producing higher-quality fixes, and causing lower runtime overheads. Our results imply that FAPR can potentially help instructors or TAs to effectively locate bugs in incorrect code, and to provide debugging hints/guidelines based on those generated repairs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。