skip to main content
10.1145/3556787.3556859acmotherconferencesArticle/Chapter ViewAbstractPublication PageswipsceConference Proceedingsconference-collections
research-article

Common Patterns in Block-Based Robot Programs

Published:31 October 2022Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Martin Fowler. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley, Boston, MA, USA.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle ScholarCross RefCross Ref
  7. 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 ScholarGoogle Scholar
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. Sung Eun Jung and Eun-sok Won. 2018. Systematic Review of Research Trends in Robotics Education for Young Children. Sustainability 10, 4 (2018).Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. Louridas. 2006. Static code analysis. IEEE Software 23, 4 (2006), 58–61. https://doi.org/10.1109/MS.2006.114Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarCross RefCross Ref
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. J. Novak, A. Krajnc, and R. Žontar. 2010. Taxonomy of static code analysis tools. In The 33rd International Convention MIPRO. 418–422.Google ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle Scholar
  20. Juha Sorva. 2018. Misconceptions and the Beginner Programmer.Google ScholarGoogle Scholar
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarCross RefCross Ref
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarCross RefCross Ref
  26. 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 ScholarGoogle Scholar
  27. 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 ScholarGoogle Scholar

Index Terms

  1. Common Patterns in Block-Based Robot Programs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Other conferences
          WiPSCE '22: Proceedings of the 17th Workshop in Primary and Secondary Computing Education
          October 2022
          130 pages
          ISBN:9781450398534
          DOI:10.1145/3556787

          Copyright © 2022 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 31 October 2022

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed limited

          Acceptance Rates

          WiPSCE '22 Paper Acceptance Rate14of41submissions,34%Overall Acceptance Rate104of279submissions,37%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format .

        View HTML Format