Table of Contents
Fetching ...

LitterBox+: An Extensible Framework for LLM-enhanced Scratch Static Code Analysis

Benedikt Fein, Florian Obermüller, Gordon Fraser

TL;DR

Scratch block notation limits LLM usage, but LitterBox+ overcomes this by converting Scratch blocks into a textual scratchblocks representation and exposing APIs, UI, and REST interfaces for LLM-assisted explanations, questions, and fixes. The framework builds on LitterBox’s static analysis, fusing issue context with program code and a scratchblocks parser to produce targeted, executable suggestions that integrate back into the original program. Its extensible, open-source design supports multiple prompts and LLM providers, enabling scalable Scratch+LLM research and classroom use. Overall, LitterBox+ provides a practical pathway to bring context-aware AI assistance into block-based programming environments.

Abstract

Large language models (LLMs) have become an essential tool to support developers using traditional text-based programming languages, but the graphical notation of the block-based Scratch programming environment inhibits the use of LLMs. To overcome this limitation, we propose the LitterBox+ framework that extends the Scratch static code analysis tool LitterBox with the generative abilities of LLMs. By converting block-based code to a textual representation suitable for LLMs, LitterBox+ allows users to query LLMs about their programs, about quality issues reported by LitterBox, and it allows generating code fixes. Besides offering a programmatic API for these functionalities, LitterBox+ also extends the Scratch user interface to make these functionalities available directly in the environment familiar to learners. The framework is designed to be easily extensible with other prompts, LLM providers, and new features combining the program analysis capabilities of LitterBox with the generative features of LLMs. We provide a screencast demonstrating the tool at https://youtu.be/RZ6E0xgrIgQ.

LitterBox+: An Extensible Framework for LLM-enhanced Scratch Static Code Analysis

TL;DR

Scratch block notation limits LLM usage, but LitterBox+ overcomes this by converting Scratch blocks into a textual scratchblocks representation and exposing APIs, UI, and REST interfaces for LLM-assisted explanations, questions, and fixes. The framework builds on LitterBox’s static analysis, fusing issue context with program code and a scratchblocks parser to produce targeted, executable suggestions that integrate back into the original program. Its extensible, open-source design supports multiple prompts and LLM providers, enabling scalable Scratch+LLM research and classroom use. Overall, LitterBox+ provides a practical pathway to bring context-aware AI assistance into block-based programming environments.

Abstract

Large language models (LLMs) have become an essential tool to support developers using traditional text-based programming languages, but the graphical notation of the block-based Scratch programming environment inhibits the use of LLMs. To overcome this limitation, we propose the LitterBox+ framework that extends the Scratch static code analysis tool LitterBox with the generative abilities of LLMs. By converting block-based code to a textual representation suitable for LLMs, LitterBox+ allows users to query LLMs about their programs, about quality issues reported by LitterBox, and it allows generating code fixes. Besides offering a programmatic API for these functionalities, LitterBox+ also extends the Scratch user interface to make these functionalities available directly in the environment familiar to learners. The framework is designed to be easily extensible with other prompts, LLM providers, and new features combining the program analysis capabilities of LitterBox with the generative features of LLMs. We provide a screencast demonstrating the tool at https://youtu.be/RZ6E0xgrIgQ.

Paper Structure

This paper contains 13 sections, 2 figures.

Figures (2)

  • Figure 1: A buggy program displayed in the extended Scratch-gui, together with llm controls to explore the bug.
  • Figure 2: LitterBox+architecture overview.