RePurr:基于块的学习者程序的自动化修复
RePurr: Automated Repair of Block-Based Learners' Programs
AI总结:
针对基于块的学习者程序存在的语义错误修复问题,提出RePurr方法,通过改进故障定位、恢复整形手术假设及优化适应度评估,实现自动化修复,为生成学习提示提供基础。
摘要:
编程教学正越来越多地使用Scratch等基于块的语言。虽然块的使用避免了语法错误,但学习者仍会犯语义错误,需要反馈和帮助。由于教师可能在课堂上被求助请求淹没、自身缺乏编程专业知识,或在自主学习场景中无法提供帮助,自动化提示生成十分必要。自动化程序修复(APR)可为此提供基础,但依赖多个假设:(1)APR通常针对孤立错误,但学习者可能从根本上误解任务,或为严重不完整的代码请求帮助。(2)软件测试需用于引导搜索和定位错误块,但基于块的程序测试与以往APR研究中的测试不同:它们由系统测试组成,且很少能完全覆盖代码;同时,Scratch程序的动画和交互导致测试运行时间大幅延长,阻碍了搜索的适用性。(3)“整形手术假设”认为修复所需代码已存在于代码库中,但基于块的程序往往规模小,可能缺乏这种冗余。为研究此类程序的APR是否仍可行,我们引入了(据我们所知)首个基于进化搜索的Scratch APR方法。我们的RePurr原型包括:对故障定位进行新颖改进以提升测试套件的引导性;利用学习场景提供的模型和学生解决方案恢复“整形手术假设”;通过测试并行化和加速降低适应度评估成本。对真实学习者程序集的实证评估证实了预期挑战,但也表明APR仍能有效改进和修复学习者程序,为自动化提示和反馈生成奠定基础。
英文摘要:
Programming is increasingly taught using block-based languages like Scratch. While the use of blocks prevents syntax errors, learners can still make semantic mistakes, requiring feedback and help. As teachers may be overwhelmed by help requests in a classroom, may lack programming expertise themselves, or may be unavailable in independent learning scenarios, automated hint generation is desirable. Automated program repair (APR) can provide the foundation for this, but relies on multiple assumptions: (1) APR usually targets isolated bugs, but learners may fundamentally misunderstand tasks or request help for substantially incomplete code. (2) Software tests are required to guide the search and localize broken blocks, but tests for block-based programs are different to those in past APR research: They consist of system tests, and very few of them already fully cover the code. At the same time, they have vastly longer runtimes due to animations and interactions on Scratch programs, which inhibits the applicability of search. (3) The plastic surgery hypothesis assumes the code necessary for repairs already exists in the codebase. Block-based programs tend to be small and may lack this redundancy. To study if APR of such programs is still feasible, we introduce, to the best of our knowledge, the first APR approach for Scratch based on evolutionary search. Our RePurr prototype includes novel refinements of fault localization to improve the guidance of test suites, recovers the plastic surgery hypothesis by exploiting that learning scenarios provide model and student solutions, and reduces the costs of fitness evaluations via test parallelization and acceleration. Empirical evaluation on a set of real learners' programs confirms the anticipated challenges, but also demonstrates APR can still effectively improve and fix learners' programs, enabling automated generation of hints and feedback.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。