Improving Readability of Scratch Programs with Search-based Refactoring
Felix Adler, Gordon Fraser, Eva Gr\"undinger, Nina K\"orber, Simon, Labrenz, Jonas Lerchenberger, Stephan Lukasczyk, Sebastian Schweikl

TL;DR
This paper presents a search-based method to automatically refactor Scratch programs, improving their readability by applying atomic transformations that reduce complexity and entropy, aiding learners and teachers.
Contribution
It introduces a novel multi-objective search approach for automated refactoring of Scratch code, addressing the lack of abstraction mechanisms in block-based programming.
Findings
Refactorings reduced complexity and entropy in 70.4% of cases
354 projects improved in at least one metric without regressions
Automated transformations help novices and teachers improve code quality
Abstract
Block-based programming languages like Scratch have become increasingly popular as introductory languages for novices. These languages are intended to be used with a "tinkering" approach which allows learners and teachers to quickly assemble working programs and games, but this often leads to low code quality. Such code can be hard to comprehend, changing it is error-prone, and learners may struggle and lose interest. The general solution to improve code quality is to refactor the code. However, Scratch lacks many of the common abstraction mechanisms used when refactoring programs written in higher programming languages. In order to improve Scratch code, we therefore propose a set of atomic code transformations to optimise readability by (1) rewriting control structures and (2) simplifying scripts using the inherently concurrent nature of Scratch programs. By automating these…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Teaching and Learning Programming
