ABSTRACT
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.
- David Bau, Jeff Gray, Caitlin Kelleher, Josh Sheldon, and Franklyn Turbak. 2017. Learnable Programming: Blocks and Beyond. Commun. ACM 60, 6 (May 2017), 72–80. https://doi.org/10.1145/3015455Google ScholarDigital Library
- Bryce Boe, Charlotte Hill, Michelle Len, Greg Dreschler, Phillip Conrad, and Diana Franklin. 2013. Hairball: Lint-inspired static analysis of scratch projects. SIGCSE 2013 - Proceedings of the 44th ACM Technical Symposium on Computer Science Education, 215–220. https://doi.org/10.1145/2445196.2445265Google ScholarDigital Library
- Martin Fowler. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley, Boston, MA, USA.Google ScholarDigital Library
- Gordon Fraser, Ute Heuer, Nina Körber, Florian Obermüller, and Ewald Wasmeier. 2021. LitterBox: A Linter for Scratch Programs. In 2021 IEEE/ACM 43rd International Conference on Software Engineering: Software Engineering Education and Training (ICSE-SEET). 183–188. https://doi.org/10.1109/ICSE-SEET52601.2021.00028Google ScholarDigital Library
- Christoph Frädrich, Florian Obermüller, Nina Körber, Ute Heuer, and Gordon Fraser. 2020. Common Bugs in Scratch Programs. In Proceedings of the 2020 ACM Conference on Innovation and Technology in Computer Science Education (Trondheim, Norway) (ITiCSE ’20). 89–95. https://doi.org/10.1145/3341525.3387389Google ScholarDigital Library
- Felienne Hermans and Efthimia Aivaloglou. 2016. Do code smells hamper novice programming? A controlled experiment on Scratch programs. In IEEE International Conference on Program Comprehension (ICPC). 1–10. https://doi.org/10.1109/ICPC.2016.7503706Google ScholarCross Ref
- Felienne Hermans, Kathryn T. Stolee, and David Hoepelman. 2016. Smells in Block-Based Programming Languages. In 2016 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC) (Cambridge, United Kingdom, 2016-09). IEEE, 68–72. https://doi.org/10.1109/VLHCC.2016.7739666Google Scholar
- David Hovemeyer and William Pugh. 2004. Finding Bugs is Easy. SIGPLAN Not. 39, 12 (Dec. 2004), 92–106. https://doi.org/10.1145/1052883.1052895Google ScholarDigital Library
- David E Johnson. 2016. ITCH: Individual Testing of Computer Homework for Scratch Assignments. In Proceedings of the 47th ACM Technical Symposium on Computing Science Education. ACM, 223–227.Google ScholarDigital Library
- Sung Eun Jung and Eun-sok Won. 2018. Systematic Review of Research Trends in Robotics Education for Young Children. Sustainability 10, 4 (2018).Google Scholar
- Nina Körber, Lisa Bailey, Luisa Greifenstein, Gordon Fraser, Barbara Sabitzer, and Marina Rottenhofer. 2021. An Experience of Introducing Primary School Children to Programming Using Ozobots (Practical Report). Association for Computing Machinery, New York, NY, USA. https://doi.org/10.1145/3481312.3481347Google ScholarDigital Library
- P. Louridas. 2006. Static code analysis. IEEE Software 23, 4 (2006), 58–61. https://doi.org/10.1109/MS.2006.114Google ScholarDigital Library
- John Maloney, Mitchel Resnick, Natalie Rusk, Brian Silverman, and Evelyn Eastmond. 2010. The Scratch Programming Language and Environment. ACM Transactions on Computing Education (TOCE) 10 (11 2010), 16.Google ScholarDigital Library
- Henry B. Mann and Donald R. Whitney. 1947. On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. The Annals of Mathematical Statistics 18, 1 (1947), 50 – 60. https://doi.org/10.1214/aoms/1177730491Google ScholarCross Ref
- Monica M. McGill and Adrienne Decker. 2020. Tools, Languages, and Environments Used in Primary and Secondary Computing Education. In Proceedings of the 2020 ACM Conference on Innovation and Technology in Computer Science Education (Trondheim, Norway) (ITiCSE ’20). Association for Computing Machinery, New York, NY, USA, 103–109. https://doi.org/10.1145/3341525.3387365Google ScholarDigital Library
- Jesús Moreno-León and Gregorio Robles. 2014. Automatic detection of bad programming habits in scratch: A preliminary study. In IEEE Frontiers in Education Conference (FIE) Proceedings. 1–4. https://doi.org/10.1109/FIE.2014.7044055Google Scholar
- J. Novak, A. Krajnc, and R. Žontar. 2010. Taxonomy of static code analysis tools. In The 33rd International Convention MIPRO. 418–422.Google Scholar
- Florian Obermüller, Lena Bloch, Luisa Greifenstein, Ute Heuer, and Gordon Fraser. 2021. Code Perfumes: Reporting Good Code to Encourage Learners. Association for Computing Machinery. https://doi.org/10.1145/3481312.3481346Google ScholarDigital Library
- LH Peng, MH Bai, and I Siswanto. 2020. A study of learning motivation of senior high schools by applying unity and mblock on programming languages courses. In Journal of Physics: Conference Series, Vol. 1456. IOP Publishing, 012037.Google Scholar
- Juha Sorva. 2018. Misconceptions and the Beginner Programmer.Google Scholar
- Andreas Stahlbauer, Christoph Frädrich, and Gordon Fraser. 2020. Verified from Scratch: Program Analysis for Learners’ Programs. In In Proceedings of the International Conference on Automated Software Engineering (ASE). IEEE.Google ScholarDigital Library
- Andreas Stahlbauer, Marvin Kreis, and Gordon Fraser. 2019. Testing scratch programs automatically. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 165–175.Google ScholarDigital Library
- Amanda Sullivan and Marina Umaschi Bers. 2016. Robotics in the early childhood classroom: learning outcomes from an 8-week robotics curriculum in pre-kindergarten through second grade. International Journal of Technology and Design Education 26, 1(2016), 3–20.Google ScholarCross Ref
- Alaaeddin Swidan, Felienne Hermans, and Marileen Smit. 2018. Programming Misconceptions for School Students. In Proceedings of the 2018 ACM Conference on International Computing Education Research (Espoo, Finland) (ICER ’18). Association for Computing Machinery, New York, NY, USA, 151–159. https://doi.org/10.1145/3230977.3230995Google ScholarDigital Library
- Peeratham Techapalokul and Eli Tilevich. 2017. Quality Hound — An online code smell analyzer for scratch programs. In IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC). 337–338.Google ScholarCross Ref
- Peeratham Techapalokul and Eli Tilevich. 2017. Understanding Recurring Quality Problems and Their Impact on Code Sharing in Block-Based Software. In IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC). IEEE, 43–51.Google Scholar
- Andras Vargha and Harold Delaney. 2000. A Critique and Improvement of the ”CL” Common Language Effect Size Statistics of McGraw and Wong. Journal of Educational and Behavioral Statistics - J EDUC BEHAV STAT 25 (06 2000). https://doi.org/10.2307/1165329Google Scholar
Index Terms
- Common Patterns in Block-Based Robot Programs
Recommendations
Code Perfumes: Reporting Good Code to Encourage Learners
WiPSCE '21: Proceedings of the 16th Workshop in Primary and Secondary Computing EducationBlock-based programming languages like enable children to be creative while learning to program. Even though the block-based approach simplifies the creation of programs, learning to program can nevertheless be challenging. Automated tools such as ...
Common Bugs in Scratch Programs
ITiCSE '20: Proceedings of the 2020 ACM Conference on Innovation and Technology in Computer Science EducationBugs in SCRATCH programs can spoil the fun and inhibit learning success. Many common bugs are the result of recurring patterns of bad code. In this paper we present a collection of common code patterns that typically hint at bugs in SCRATCH programs, ...
A Comparative Study of Bug Patterns in Java Cloned and Non-cloned Code
SCAM '14: Proceedings of the 2014 IEEE 14th International Working Conference on Source Code Analysis and ManipulationCode cloning via copy-and-paste is a common practice in software engineering. Traditionally, this practice has been considered harmful, and a symptom that some important design abstraction is being ignored. As such, many previous studies suggest ...
Comments