An Empirical Study of Code Pattern Reuse and Pattern Preference Consistency in Novice Programmers

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

Abstract

After learning the basic features of a programming language, such as expressions and control statements, novice programmers need to combine these features to solve programming questions. Some of these combined code snippets are reusable constructs useful to solve future questions. They are referred to as plans, schemas, or patterns in the literature. An example of such a pattern is determining the equality of three values using the ‘equal and logical and operators. Previous research has investigated the acquisition of these patterns by observing and interviewing novice programmers as they solve programming problems. In this paper, we test the hypothesis that students tend to reuse acquired patterns to solve subsequent problems by analyzing a computer science education dataset called CodeWorkout, which contains students’ code submissions for introductory-level programming questions. We employed directed labeled tree to represent the Abstract Syntax Tree (AST) of the submitted code and the patterns. To search for a pattern, we first applied the subgraph isomorphism algorithm VF2 with wildcard node labels to identify candidate matches, followed by enforcing the proper ordering of descendant nodes between the pattern and the candidate matches. Experimental results demonstrate that our approach effectively identifies common usage of patterns. Moreover, the findings indicate that if a student employs a pattern in one question, they are likely to reuse the same pattern in a subsequent question. This paper also reveals that when multiple alternative patterns exist for the same function, students tend to maintain their preference for a particular alternative while solving different questions. These insights can inform future curriculum design and instructional strategies in programming education.

Original languageEnglish
Title of host publicationLearning Technologies and Systems - 23rd International Conference on Web-Based Learning, ICWL 2024 and 9th International Symposium on Emerging Technologies for Education, SETE 2024, Revised Selected Papers
EditorsTianyong Hao, Junjie Gavin Wu, Xiangfeng Luo, Yan Sun, Yuanyuan Mu, Shili Ge, Wenxiu Xie
PublisherSpringer Science and Business Media Deutschland GmbH
Pages59-70
Number of pages12
ISBN (Print)9789819644063
DOIs
Publication statusPublished - 2025
Event23rd International Conference on Web-Based Learning, ICWL 2024 was held in conjunction with the 9th International Symposium on Emerging Technologies for Education, SETE 2024 - Shanghai, China
Duration: 26 Nov 202428 Nov 2024

Publication series

NameLecture Notes in Computer Science
Volume15589 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference23rd International Conference on Web-Based Learning, ICWL 2024 was held in conjunction with the 9th International Symposium on Emerging Technologies for Education, SETE 2024
Country/TerritoryChina
CityShanghai
Period26/11/2428/11/24

Keywords

  • Code patterns
  • Computer Science Education
  • Student modelling

Fingerprint

Dive into the research topics of 'An Empirical Study of Code Pattern Reuse and Pattern Preference Consistency in Novice Programmers'. Together they form a unique fingerprint.

Cite this