🤖 AI Summary
This study addresses behavioral inconsistencies in event-driven block-based programming environments like Scratch, which arise from non-deterministic scheduling orders. The work presents the first formalization of their concurrent semantics and scheduling space, introducing a parameterized framework for analyzing scheduling robustness. Leveraging dependency equivalence classes, partial-order reduction, and observation lens lattices, the authors implement SchedCheck—an analysis tool integrated into the actual Scratch virtual machine—that efficiently enumerates execution traces and compares cross-schedule behaviors. Empirical evaluation reveals that 21% of 224 student projects exhibit scheduling sensitivity, with a reproducibility rate of 17.6% in sampled public projects. SchedCheck successfully detects all 32 benchmark faults and identifies four incompletenesses in existing dependency models, uncovering widespread scheduling fragility in block-based programs.
📝 Abstract
Block-based languages such as Scratch let beginners assemble interactive programs from sprites and scripts. These programs are concurrent in practice: green-flag scripts, broadcasts, and clones run as cooperatively scheduled threads over shared sprite and stage state, and their authors never write a thread. We show that such programs contain schedule-sensitive behaviors whose observable result depends on an execution order the language leaves open. Editing, saving, or remixing a project can produce a copy with the same blocks but a different layer order, changing the order the virtual machine starts scripts. We formalize the schedule space a Scratch virtual machine can realize as the permutations of the initial executable-target order, and define schedule-robustness against a lattice of observation lenses over a fixed horizon. A partial-order exploration runs one schedule per dependence-equivalence class, and on projects small enough to enumerate, an independent oracle confirms it recovers every realizable outcome. On larger projects, representatives stand in for the factorial under the validated dependence model. SchedCheck implements this on the production Scratch VM. Across 224 real student projects, at least 21% of the concurrent ones are schedule-sensitive at the grading lens, and a uniform random sample of public projects replicates the rate at 17.6%, with two real remixes of a deployed animation arranging its letters differently. On hand-built fault pairs and a generated benchmark of 32 spec-defined faults across four classes, the tool detects and localizes every schedule fault, with a logic-fault control reporting clean. The oracle exposed four unsoundness gaps in the dependence model, all repaired. The method is parametric in the execution model, instantiating unchanged on a second cooperative event loop.