Verified from Scratch: Program Analysis for Learners' Programs
Andreas Stahlbauer, Christoph Frädrich, Gordon Fraser
Abstract
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. CCS CONCEPTS • Software and its engineering → Integrated and visual development environments; Software testing and debugging.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 20429bf4-0bc3-4634-896d-43ccbaac6ed8Related papers
- On the Applicability of Language Models to Block-Based ProgramsElisabeth Griebl, Benedikt Fein, Florian Obermüller, Gordon Fraser et al.ICSE 2023 · 5 citations
- VisionScratch: LLM-Based Automated Feedback Generation using Code-Produced Videos for Scratch ProgramsYuan Si, Daming Li, Hanyuan Shi, Jialu ZhangFSE 2026 · 1 citation
- RePurr: Automated Repair of Block-Based Learners' ProgramsSebastian Schweikl, Gordon FraserFSE 2025
- ScratchNet: A Multi-modal Benchmark for Evaluating and Advancing LLMs on Scratch Programming TasksYuan Si, Simeng Han, Daming Li, Hanyuan Shi et al.ISSTA 2026
- ChatScratch: An AI-Augmented System Toward Autonomous Visual Programming Learning for Children Aged 6-12Liuqing Chen, Shuhong Xiao, Yunnong Chen, Yaxuan Song et al.CHI 2024 · 56 citations
