Model-based Testing of Scratch Programs

02/13/2022
by   Katharina Götz, et al.
0

Learners are often introduced to programming via dedicated languages such as Scratch, where block-based commands are assembled visually in order to control the interactions of graphical sprites. Automated testing of such programs is an important prerequisite for supporting debugging, providing hints, or assessing learning outcomes. However, writing tests for Scratch programs can be challenging: The game-like and randomised nature of typical Scratch programs makes it difficult to identify specific timed input sequences used to control the programs. Furthermore, precise test assertions to check the resulting program states are incompatible with the fundamental principle of creative freedom in programming in Scratch, where correct program behaviour may be implemented with deviations in the graphical appearance or timing of the program. The event-driven and actor-oriented nature of Scratch programs, however, makes them a natural fit for describing program behaviour using finite state machines. In this paper, we introduce a model-based testing approach by extending Whisker, an automated testing framework for Scratch programs. The model-based extension describes expected program behaviour in terms of state machines, which makes it feasible to check the abstract behaviour of a program independent of exact timing and pixel-precise graphical details, and to automatically derive test inputs testing even challenging programs. A video demonstrating model-based testing with Whisker is available at the following URL: https://youtu.be/edgCNbGSGEY

READ FULL TEXT
research
02/13/2022

Automated Test Generation for Scratch Programs

The importance of programming education has lead to dedicated educationa...
research
09/09/2020

Search-based Testing for Scratch Programs

Block-based programming languages enable young learners to quickly imple...
research
02/15/2021

LitterBox: A Linter for Scratch Programs

Creating programs with block-based programming languages like Scratch is...
research
08/16/2021

Improving Readability of Scratch Programs with Search-based Refactoring

Block-based programming languages like Scratch have become increasingly ...
research
08/29/2022

Neuroevolution-Based Generation of Tests and Oracles for Games

Game-like programs have become increasingly popular in many software eng...
research
08/16/2021

Data-driven Analysis of Gender Differences and Similarities in Scratch Programs

Block-based programming environments such as Scratch are an essential en...
research
04/05/2023

Code Critters: A Block-Based Testing Game

Learning to program has become common in schools, higher education and i...

Please sign up or login with your details

Forgot password? Click here to reset