Test Early: An Approach to Introduce Younger Students to Unit Testing with Graphical Comparison in Scratch
Authors:
- 27 April 2025
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 129-134
Abstract
This Idea Paper examines the benefits and tooling support needed to introduce testing concepts to younger students. Unit testing typically involves comparing the expected and actual values of a program's results. Traditionally, the comparison is performed on primitives like numbers and strings, or a specific object's state. However, in a Blocks-Based Programming Language (BBPL) like Scratch, which is often used to introduce younger students to programming concepts, the output is often graphical. Thus, there is a need to compare the results from the visual output. The shift from textual to visual assessment highlights the need for methods to evaluate the visual output produced by Scratch programs. Influenced by concepts from traditional unit testing frameworks, our approach focuses on simple testing capabilities in Scratch projects, particularly those with visual outputs. This Idea Paper introduces our graphical comparison method and a supporting tool to evaluate the behavior of Scratch programs. Our approach involves comparing two-dimensional (2D) images representing the expected and actual output after execution of a Scratch program. We performed an initial experiment of our unit testing tool using Scratch programs available from creativeprogramming.org, a platform that hosts an international Scratch Olympiad competition for students of various ages. We present the initial results of evaluating our approach with student projects from this platform, demonstrating how our approach can serve as an initial effort at introducing testing into programming environments that support younger students. We also discuss how such a tool can be used to assist teachers with autograding of Scratch programs.Keywords
Funding Information
- United States Department of Education
This publication has 23 references indexed in Scilit:
- Comparison Experiment of Learning State Between Visual Programming Language and Text Programming Language2021
- A Low-Effort Analytics Platform for Visualizing Evolving Flask-Based Python Web Services2017
- Automatic detection of bad programming habits in scratch: A preliminary study2014
- JUnit framework: An interactive approach for basic unit testing learning in Software Engineering2012
- Web Application Tests with SeleniumIEEE Software, 2009
- A survey of unit testing practicesIEEE Software, 2006
- Test-driven development concepts, taxonomy, and future directionComputer, 2005
- Image quality assessment: from error visibility to structural similarityIEEE Transactions on Image Processing, 2004
- A Simple and Practical Approach to Unit Testing: The JML and JUnit Way2002
- Hierarchical GUI test case generation using automated planningIEEE Transactions on Software Engineering, 2001