paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Testing scratch programs automatically

自动测试 Scratch 程序
FSE Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2019匹配度 1/10 · 论文关注 Scratch 教育编程环境的自动化测试与形式化测试框架,属于软件测试/编程教育方向,并未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心研究方向。引用 49 inbox
Andreas Stahlbauer, Marvin Kreis, Gordon Fraser
crossref: 2026-09-12

AI 速览

一句话:提出 Scratch 程序测试的形式框架并实现 Whisker,支持自动化与基于属性的测试。

Scratch 等积木式编程环境让初学者无需处理语法错误,但功能错误仍可能导致程序行为不正确,目前识别和理解这些错误完全依赖人工。本文提出一个形式化测试框架,详细刻画 Scratch 程序测试问题,并实例化为 Whisker 工具,为 Scratch 程序提供自动化、基于属性的测试功能。在真实学生和教师程序上的实证评估表明,Whisker 能成功测试 Scratch 程序,平均达到 95.25% 代码覆盖率;虽然测试不稳定等问题在 Scratch 场景同样存在,但自动化与基于属性的测试能准确复现并替代教师繁琐的人工评分工作,为支持编程学习者提供新途径。

问题
Scratch 初学者程序中的功能错误难以自动发现,教师人工检查与评分负担沉重。
方法
提出形式化测试框架,并实现 Whisker,对 Scratch 程序进行自动化和基于属性的测试。
评估
在真实学生与教师程序上评估,平均达到 95.25% 代码覆盖率,并验证其可复现和替代人工评分,同时发现测试不稳定问题。
原文摘要(Abstract)

Block-based programming environments like Scratch foster engagement with computer programming and are used by millions of young learners. Scratch allows learners to quickly create entertaining programs and games, while eliminating syntactical program errors that could interfere with progress. However, functional programming errors may still lead to incorrect programs, and learners and their teachers need to identify and understand these errors. This is currently an entirely manual process. In this paper, we introduce a formal testing framework that describes the problem of Scratch testing in detail. We instantiate this formal framework with the Whisker tool, which provides automated and property-based testing functionality for Scratch programs. Empirical evaluation on real student and teacher programs demonstrates that Whisker can successfully test Scratch programs, and automatically achieves an average of 95.25 % code coverage. Although well-known testing problems such as test flakiness also exist in the scenario of Scratch testing, we show that automated and property-based testing can accurately reproduce and replace the manually and laboriously produced grading efforts of a teacher, and opens up new possibilities to support learners of programming in their struggles.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5129,
  title = {Testing scratch programs automatically},
  author = {Andreas Stahlbauer and Marvin Kreis and Gordon Fraser},
  booktitle = {FSE},
  year = {2019},
  doi = {10.1145/3338906.3338910}
}