论文标题

基于模型的刮擦程序测试

Model-based Testing of Scratch Programs

论文作者

Götz, Katharina, Feldmeier, Patric, Fraser, Gordon

论文摘要

学习者通常会通过专用语言(例如Scratch)介绍编程,其中基于块的命令是在视觉上组装的,以控制图形精灵的交互。对此类程序的自动测试是支持调试,提供提示或评估学习成果的重要先决条件。但是,刮擦程序的编写测试可能具有挑战性:典型的刮擦程序的类似游戏的和随机的性质使得难以识别用于控制程序的特定定时输入序列。此外,检查结果程序状态的精确测试主张与在Scratch编程中的基本原则不兼容,在该计划中,可以在程序的图形外观或程序的时间安排中实现正确的程序行为。然而,以事件为导向的划痕程序的性质和以演员为导向的性质使它们自然地适合使用有限状态机器来描述程序行为。在本文中,我们通过扩展Whisker(用于刮擦程序的自动测试框架)来介绍一种基于模型的测试方法。基于模型的扩展在国家机器方面描述了预期的程序行为,这使得可以独立于确切的时序和Pixel-Presise图形详细信息检查程序的抽象行为,并自动得出测试输入测试,甚至具有挑战性的程序。以下URL可用:https://youtu.be/edgcnbgsgey提供了一个基于模型的测试的视频。

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

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源