University of Alberta
Understanding and Modeling the Evolution of Scratch3 Projects for Generalizable Visual Code Completion.
Abstract
dc:description.abstractScratch3, a widely used visual programming language for young programmers (ages 8–16), lacks both a comprehensive analysis of project evolution patterns and a generalizable next-token suggestion model to enhance end-user programming efficiency. Current Scratch code completion systems rely on models trained and evaluated on in-distribution datasets, limiting their robustness when applied to unseen projects. Additionally, prior work often excludes specific node blocks during training, further constraining the practical utility of these models in real-world scenarios. To address these gaps, we propose a two-fold approach. First, we introduce a novel dataset of historical changes from 1,475 Scratch3 projects extracted using World of Code from GitHub, providing unique insights into project evolution through commits, nodes, edges, authors, and revisions. Our grounded theory analysis reveals that Scratch developers primarily focus on User Interface and Experience improvements, node list code block manipulations for data processing, and program refactoring through file renaming, while also incorporating custom blocks, control flows, and extensions (functionally analogous to external APIs in textual programming). We further observe that Scratch files evolve through the addition of animations to enhance sprite capabilities, modifications of existing animations for functionality updates, relocation of scripts from sprites to backdrops, and refactoring through file renaming and project reorganization. Second, we train and evaluate code completion models on Scratch3 datasets to enhance programmer efficiency. We construct multiple training and test sets with varying ratios from our dataset and evaluate the generalizability of three models: MLE (nltk.lm.api), KenLM, and BiLSTM on unseen Scratch3 projects. This investigation explores how training size and dataset composition influence model performance across different evaluation metrics. Overall, our findings demonstrate that model performance remains stable on all metrics for the KenLM model, notably performing equally well beyond the 20% training sample across all metrics. Additionally, no visible variation is observed in metric distributions across projects. A similar trend was observed with the MLE (nltk.lm.api) model, though it exhibits an upward trend with more training samples, corroborating its dependence on additional context for improved performance. Surprisingly, the BiLSTM model exhibited a downward trend with the introduction of additional training data, suggesting that Scratch programmers may duplicate visual source code. These insights contribute to understanding how dataset size and composition influence code completion models, particularly in Scratch3 projects. Our research addresses critical gaps in Scratch3 programming through a novel dataset of 1,475 projects, revealing key evolution patterns while demonstrating that code completion models start with slight performance improvements between the 10% and 20% training samples, but perform equally well beyond this threshold—suggesting that only about 20% of the training sample is needed to produce a generalizable visual source code completion model.
Degree
thesis:*- Name thesis:degree_name
- Master of Science
- Level thesis:degree_level
- Master's
- Grantor
- University of Alberta
- Year dc:date.issued
- 2025
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- IWUCHUKWU, SAMUEL JOEL
- Advisor dc:contributor.advisor
-
- Hindle, Abram (Computing Science)
Subjects
dc:subject × 5Rights
dc:rights- Statement dc:rights
-
- This thesis is made available by the University of Alberta Library with permission of the copyright owner solely for non-commercial purposes. This thesis, or any portion thereof, may not otherwise be copied or reproduced without the written consent of the copyright owner, except to the extent permitted by Canadian copyright law.
- Language dc:language.iso
- en
Identifiers
dc:identifier.*- DOI dc:identifier.doi
- https://doi.org/10.7939/83414