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

Philip I.S. Lei, António José Mendes, Chan Tong Lam

研究成果: Conference contribution同行評審

摘要

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.

原文English
主出版物標題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
編輯Tianyong Hao, Junjie Gavin Wu, Xiangfeng Luo, Yan Sun, Yuanyuan Mu, Shili Ge, Wenxiu Xie
發行者Springer Science and Business Media Deutschland GmbH
頁面59-70
頁數12
ISBN(列印)9789819644063
DOIs
出版狀態Published - 2025
事件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 - Shanghai, China
持續時間: 26 11月 202428 11月 2024

出版系列

名字Lecture Notes in Computer Science
15589 LNCS
ISSN(列印)0302-9743
ISSN(電子)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
國家/地區China
城市Shanghai
期間26/11/2428/11/24

指紋

深入研究「An Empirical Study of Code Pattern Reuse and Pattern Preference Consistency in Novice Programmers」主題。共同形成了獨特的指紋。

引用此