基于块的机器人程序中的常见模式
Common Patterns in Block-Based Robot Programs
摘要:
可编程机器人具有吸引力,玩起来很有趣,与现实世界互动,因此非常适合向年轻学习者介绍编程。介绍性的机器人程序设计语言通常扩展现有的基于块的语言,如Scratch。虽然用这些语言进行编程教学已经很成熟,但机器人程序中与现实世界的交互会带来特定的挑战,学习者和教育者可能需要帮助和反馈。提供这种反馈的一种实用方法是识别并指出代码中指示好或坏解决方案的模式。虽然这种模式已经被定义为常规的基于块的程序,机器人特定的编程方面还没有考虑到目前为止。因此,本文的目的是确定特定的模式,机器人编程的基于Sockerch的mBlock程序设计语言,这是用于流行的mBot和科迪洛基机器人。我们确定:(1)26种错误模式,表示错误的代码;(2)3种代码气味,表示可能工作但以令人困惑或难以理解的方式编写的代码;(3)18种代码气味,表示代码可能很好的方面。我们扩展了LitterBox分析框架,以自动识别mBlock程序中的这些模式。在3,540个mBlock程序的数据集上进行评估,我们总共发现了6,129个错误模式,592个代码气味和14,495个代码气味。这证明了我们的方法为学习者和教育者提供反馈和帮助的潜力。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。