一句话:将异常检测用于 Scratch 课堂作业,无需人工规约即可发现代码偏差。
在编程教育中,教师需要检查学生代码以评估学习进度。传统语言的代码质量可用测试、验证工具或 linter 自动评估,但这些方法通常依赖教师难以编写的形式规约,且面向 Scratch 等块状入门语言的类似支持不足。本文把异常检测引入课堂场景,自动识别 Scratch 代码中偏离常见行为的模式,异常可能对应错误代码、替代解法或突出作品。作者在不同编程任务的 Scratch 解法上评估,结果表明该方法既能用于规约严格的作业,也能用于开放式任务。
In programming education, teachers need to monitor and assess the progress of their students by investigating the code they write. Code quality of programs written in traditional programming languages can be automatically assessed with automated tests, verification tools, or linters. In many cases these approaches rely on some form of manually written formal specification to analyze the given programs. Writing such specifications, however, is hard for teachers, who are often not adequately trained for this task. Furthermore, similar support for popular block-based introductory programming languages like Scratch is lacking. Anomaly detection is an approach to automatically identify deviations of common behavior in datasets without any need for writing a specification. In this paper, we use anomaly detection to automatically find deviations of Scratch code in a classroom setting, where anomalies can represent erroneous code, alternative solutions, or distinguished work. Evaluation on solutions of different programming tasks demonstrates that anomaly detection can successfully be applied to tightly specified as well as open-ended programming tasks.