Re-use of programming patterns or problem solving? Representation of scratch programs by TGraphs to support static code analysis

Mike Talbot, Katharina Geldreich, Julia Sommer, Peter Hubwieser

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

7 Scopus citations

Abstract

Novice programmers seem to learn basic programming skills amazingly fast by using visual programming environments like Scratch or Snap. Yet at a second glance, in many cases, the students' programming projects make use of pre-learned solution patterns like collision detection. Aiming to investigate how far such pre-learned patterns are used and adapted, we have to analyze the program structure of a substantially large number of Scratch projects, e.g. from the Scratch repository, in a very detailed way. To automate the static code analysis of these projects, we developed a scheme to transform Scratch projects into a common graph format (TGraph), which was used up to now to analyze programs in Java and Haskell as well as UML diagrams and mathematical solutions. In a second step, this representation enabled us to apply a SQL-like query language for graphs (GReQL) to detect programming patterns in students' Scratch projects. This paper describes the design of our TGraph scheme for Scratch as well as how to query patterns in Scratch code using GReQL, in order to stimulate the use of this methodology by other researchers. As a feasibility study, we report its application on the outcomes of one of our Scratch courses attended by 143 children aged 8-12 years. The study showed that with the presented methodology any code structure can be detected in Scratch projects. To check the validity of the methodology, the programs were additionally checked manually for the occurrence of two patterns - the results were consistent.

Original languageEnglish
Title of host publicationProceedings of the 15th Workshop in Primary and Secondary Computing Education, WiPSCE 2020
EditorsTorsten Brinda, Michal Armoni
PublisherAssociation for Computing Machinery
ISBN (Electronic)9781450387590
DOIs
StatePublished - 28 Oct 2020
Event15th Workshop in Primary and Secondary Computing Education, WiPSCE 2020 - Virtual, Online, Germany
Duration: 28 Oct 202030 Oct 2020

Publication series

NameACM International Conference Proceeding Series

Conference

Conference15th Workshop in Primary and Secondary Computing Education, WiPSCE 2020
Country/TerritoryGermany
CityVirtual, Online
Period28/10/2030/10/20

Keywords

  • Assessment
  • Computer science education
  • Patterns, code analysis
  • Programming
  • Scratch

Fingerprint

Dive into the research topics of 'Re-use of programming patterns or problem solving? Representation of scratch programs by TGraphs to support static code analysis'. Together they form a unique fingerprint.

Cite this