一句话:为 Scratch 定义语义并实现 Bastet 分析框架,结合抽象解释与软件模型检测支持程序分析。
Scratch 等块基语言通过隐藏底层细节和阻止语法错误来帮助学习者,但学习者与教育者仍需要自动分析来回答程序是否满足任务、为何无法运行等问题。Scratch 程序由多个高度并发的角色在图形舞台上交互,并受用户输入控制,且其块语句隐藏复杂数学运算;同时 Scratch 缺乏明确语义,使分析困难。本文用中间语言定义 Scratch 的语义,并在此基础上实现 Bastet 分析框架,采用抽象解释与软件模型检测等技术;Bastet 基于 Web 技术、以 TypeScript 编写,可在 NodeJS 或浏览器中运行。在儿童编写的 279 个程序上的评估表明该方法对 Scratch 程序分析具有实用性,可支持自动提示生成、学习进度评估和自动评分等应用。
Block-based programming languages like Scratch support learners by providing high-level constructs that hide details and by preventing syntactically incorrect programs. Questions nevertheless frequently arise: Is this program satisfying the given task? Why is my program not working? To support learners and educators, automated program analysis is needed for answering such questions. While adapting existing analyses to process blocks instead of textual statements is straightforward, the domain of programs controlled by block-based languages like Scratch is very different from traditional programs: In Scratch multiple actors, represented as highly concurrent programs, interact on a graphical stage, controlled by user inputs, and while the block-based program statements look playful, they hide complex mathematical operations that determine visual aspects and movement. Analyzing such programs is further hampered by the absence of clearly defined semantics, often resulting from ad-hoc decisions made by the implementers of the programming environment. To enable program analysis, we define the semantics of Scratch using an intermediate language. Based on this intermediate language, we implement the Bastet program analysis framework for Scratch programs, using concepts from abstract interpretation and software model checking. Like Scratch, Bastet is based on Web technologies, written in TypeScript, and can be executed using NodeJS or even directly in a browser. Evaluation on 279 programs written by children suggests that Bastet offers a practical solution for analysis of Scratch programs, thus enabling applications such as automated hint generation, automated evaluation of learner progress, or automated grading.
DOI 原文 ·
@inproceedings{paperbot5997,
title = {Verified from scratch},
author = {Andreas Stahlbauer and Christoph Frädrich and Gordon Fraser},
booktitle = {ASE},
year = {2020},
doi = {10.1145/3324884.3416554}
}