Common Patterns in Block-Based Robot Programs

08/29/2022
by   Florian Obermüller, et al.
0

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.

READ FULL TEXT

page 3

page 4

page 10

research
08/16/2021

Improving Readability of Scratch Programs with Search-based Refactoring

Block-based programming languages like Scratch have become increasingly ...
research
08/13/2021

Code Perfumes: Reporting Good Code to Encourage Learners

Block-based programming languages like Scratch enable children to be cre...
research
02/15/2021

LitterBox: A Linter for Scratch Programs

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

Identifying Bug Patterns in Quantum Programs

Bug patterns are erroneous code idioms or bad coding practices that have...
research
06/17/2022

On the Bug-proneness of Structures Inspired by Functional Programming in JavaScript Projects

Language constructs inspired by functional programming have made their w...
research
07/16/2023

Deduplicating and Ranking Solution Programs for Suggesting Reference Solutions

Referring to solution programs written by other users is helpful for lea...
research
11/18/2020

RustViz: Interactively Visualizing Ownership and Borrowing

Rust is a systems programming language that guarantees memory safety wit...

Please sign up or login with your details

Forgot password? Click here to reset