Programmable robots are engaging and fun to play with, interact with the real world, and are therefore well suited to introduce young learners to programming. Introductory robot programming languages often extend existing block-based languages such as Scratch. While teaching programming with such languages is well established, the interaction with the real world in robot programs leads to specific challenges, for which learners and educators may require assistance and feedback. A practical approach to provide this feedback is by identifying and pointing out patterns in the code that are indicative of good or bad solutions. While such patterns have been defined for regular block-based programs, robot-specific programming aspects have not been considered so far. The aim of this paper is therefore to identify patterns specific to robot programming for the Scratch-based mBlock programming language, which is used for the popular mBot and Codey Rocky robots. We identify: (1) 26 bug patterns, which indicate erroneous code; (2) three code smells, which indicate code that may work but is written in a confusing or difficult to understand way; and (3) 18 code perfumes, which indicate aspects of code that are likely good. We extend the LitterBox analysis framework to automatically identify these patterns in mBlock programs. Evaluated on a dataset of 3,540 mBlock programs, we find a total of 6,129 instances of bug patterns, 592 code smells and 14,495 code perfumes. This demonstrates the potential of our approach to provide feedback and assistance to learners and educators alike for their mBlock robot programs.
翻译:编程机器人正在与真实世界打交道,并与真实世界互动,因此非常适合向年轻学习者介绍年轻学习者进行编程。介绍性机器人编程语言往往扩展现有的基于块状语言,例如Scratch。虽然用这种语言进行编程教学已经确立,但与机器人程序中真实世界的互动却带来具体的挑战,学生和教育工作者可能需要援助和反馈。提供这种反馈的实用方法是查明和指出守则中显示好或坏解决办法的模型,指出显示好或坏解决办法的好或坏解决办法的模型,以此提供反馈。虽然为常规的基于块的程式确定了这种模式,但至今尚未考虑机器人特定的编程方面。因此,本文的目的是要确定以Scratch为基础的mcratchmBlock编程语言编制工作的现有模块。虽然用于这些语言进行编程的教学,但机器人程序与真实世界互动带来了具体的挑战,学生和教育工作者可能需要协助和难以理解的代码。 我们确认:(1) 26个错误模式,显示错误代码;(2) 三个代码嗅觉,显示代码可能起作用,但难以理解的方法写成的代码;以及(3) 18个代码香香香香香,表明可能好的代码的各个方面。