TY - GEN
T1 - An Empirical Study of Code Pattern Reuse and Pattern Preference Consistency in Novice Programmers
AU - Lei, Philip I.S.
AU - Mendes, António José
AU - Lam, Chan Tong
N1 - Publisher Copyright:
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2025.
PY - 2025
Y1 - 2025
N2 - 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.
AB - 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.
KW - Code patterns
KW - Computer Science Education
KW - Student modelling
UR - http://www.scopus.com/inward/record.url?scp=105003629787&partnerID=8YFLogxK
U2 - 10.1007/978-981-96-4407-0_5
DO - 10.1007/978-981-96-4407-0_5
M3 - Conference contribution
AN - SCOPUS:105003629787
SN - 9789819644063
T3 - Lecture Notes in Computer Science
SP - 59
EP - 70
BT - Learning 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
A2 - Hao, Tianyong
A2 - Wu, Junjie Gavin
A2 - Luo, Xiangfeng
A2 - Sun, Yan
A2 - Mu, Yuanyuan
A2 - Ge, Shili
A2 - Xie, Wenxiu
PB - Springer Science and Business Media Deutschland GmbH
T2 - 23rd International Conference on Web-Based Learning, ICWL 2024 was held in conjunction with the 9th International Symposium on Emerging Technologies for Education, SETE 2024
Y2 - 26 November 2024 through 28 November 2024
ER -