← Latest papers
💻 computer science

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

LitterBox+ is an extensible framework that bridges the gap between block-based Scratch programming and Large Language Models by converting code to text, thereby enabling learners to query LLMs about their programs, receive quality feedback, and generate code fixes directly within the Scratch environment.

Original authors: Benedikt Fein, Florian Obermüller, Gordon Fraser

Published 2026-02-09
📖 4 min read☕ Coffee break read

Original authors: Benedikt Fein, Florian Obermüller, Gordon Fraser

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are teaching a child to build with LEGO blocks. The blocks are colorful, snap together easily, and don't require typing complex words. This is Scratch, a popular way for beginners to learn programming. However, just like a child might accidentally build a wobbly tower or forget a crucial support beam, beginners often make mistakes in their code that are hard to spot.

For years, computer experts have built "smart inspectors" (called static analysis tools) that can scan text-based code and say, "Hey, you missed a loop here!" or "That variable is undefined!" One such tool for Scratch is called LitterBox. It's great at finding common mistakes, but it speaks in a very dry, technical language. It's like a robot saying, "Error: Missing Loop," without explaining why that matters or how to fix it.

Recently, Large Language Models (LLMs)—the super-smart AI chatbots we use for writing emails or stories—have become amazing at helping programmers fix text-based code. But there's a problem: LLMs don't speak "LEGO." They are trained on text, not on colorful, snapping blocks. They can't "see" a Scratch project the way a human does.

The Solution: LitterBox+

The authors of this paper built a bridge called LitterBox+. Think of it as a universal translator and a helpful tutor rolled into one.

Here is how it works, using simple analogies:

  1. The Translator (Scratch to Text):
    When a student has a Scratch project, LitterBox+ acts like a translator. It takes the colorful, block-based code and converts it into a special text format (called "scratchblocks") that the AI can read. It's like taking a photo of a LEGO castle and turning it into a written instruction manual that a text-only robot can understand.

  2. The Smart Tutor (The AI):
    Once the AI "reads" the code, the student can ask it questions directly inside the Scratch program.

    • "What's wrong?" If the LitterBox tool found a bug, the student can click a button to ask the AI to explain it in simple terms. Instead of just saying "Missing Loop," the AI might say, "Your boat only checks for water once at the start. If it hits water later, it won't know! You need to check continuously."
    • "How do I fix it?" The student can ask the AI to fix the code. The AI writes the corrected instructions in that special text format.
  3. The Builder (Text back to LEGO):
    This is the magic part. The AI doesn't just give a text answer; it actually rebuilds the LEGO. LitterBox+ has a special parser (a translator in reverse) that takes the AI's text instructions and snaps them back into the correct colorful blocks in the student's Scratch project. It's like the robot taking the written fix and physically snapping the new LEGO pieces into place for the student.

Why is this special?

  • It stays in the classroom: The student doesn't have to leave the Scratch website to talk to the AI. The AI lives right inside the programming window.
  • It's a safety net: The authors know AI can sometimes hallucinate or give wrong advice. So, they put a big red warning sign (an exclamation mark) next to the AI's answers to remind students, "This is a suggestion, double-check it!"
  • It's a toolbox for teachers and researchers: The system is built like a set of Lego bricks itself. Researchers can easily swap out the "brain" (the AI model), change the questions they ask, or add new features without rebuilding the whole thing.

What can you do with it right now?

The paper describes three main ways to use this tool:

  1. Ask Questions: "Why isn't my sprite moving?" or "How can I make this game harder?"
  2. Get Explanations: When the tool finds a bug, you can ask the AI to explain why it's a bug and give you a step-by-step guide on how to see the mistake happen.
  3. Auto-Fix: You can ask the AI to fix the bug for you, and it will automatically update your code blocks.

The authors also mention that while the tool is great, it's still a work in progress. They plan to test it with real children to see how they learn from it, and they hope other researchers will use their open-source code to build even smarter tools for visual programming.

In short, LitterBox+ takes the "smart brain" of modern AI and connects it to the "playful blocks" of Scratch, helping beginners understand their mistakes and fix them without needing to learn a new, complex language first.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →