DOI: 10.3390/educsci16111866 ISSN: 2227-7102

AI-Supported Programming Environments and Pair Programming Role Strategies in Secondary School: An Exploratory Study

Yi Zhu, Congxin Wu, Shu Zhao, Xiaoqing Shang

The integration of artificial intelligence (AI) into programming education has accelerated rapidly in recent years. Yet, existing research has largely focused on individual learning or human–AI interaction, with limited attention to human–human–AI collaboration and pair programming role strategies. This study conducted an exploratory comparison of learning outcomes across four classroom conditions combining AI support (with/without) and role strategy (fixed/rotating). Participants were 198 eighth-grade students from four intact classes in a public junior secondary school in Xi’an, China, who participated in an eight-week programming course. Linear mixed-effects models were used to examine programming performance, computational thinking, cognitive load, and programming anxiety. Programming performance differed by classroom condition (p = 0.023) and session (p = 0.014), with a significant classroom-condition-by-session interaction (p = 0.010). Tukey-adjusted comparisons showed higher estimated means in the AI-supported/rotating-role classroom than in the non-AI/fixed-role classroom in Session 1 and the AI-supported/fixed-role classroom in Session 2. Computational thinking did not differ significantly across conditions. The non-AI/fixed-role classroom showed higher cognitive load than the non-AI/rotating-role and AI-supported/rotating-role classrooms, and higher programming anxiety than the other three classrooms. Overall, this study offers exploratory insights into AI-supported programming and pair-programming roles in secondary education.

More from our Archive