Background and context: Debugging is a significant and often frustrating challenge for beginner programmers. Understanding students' debugging behaviours and strategies can help to identify common difficulties and inform approaches for alleviating these. Currently, there are limited studies of school students' debugging behaviour in a text-based programming language, a medium through which millions are learning to program. Objectives: In this paper, we investigate the debugging behaviour of 12-14-year-old students learning Python through a lesson-long classroom study. Method: We collected program snapshots from 73 students' attempts at a set of Python debugging exercises in an online code editor. Through qualitative content analysis of these snapshots, we developed a granular categorisation of the changes students made when debugging. Findings: While most students were able to resolve some errors, most also frequently exhibited ineffective debugging behaviours. Many students added errors through small-scale changes, reverted corrective changes, and repeatedly ran identical programs in quick succession. From the results, we identify four barriers to successful and reliable debugging for students learning a text-based programming language: fragile knowledge, a lack of systematicity and reflection, the syntax barrier, and dynamics of emotions and attitudes. Implications: This paper highlights some of the difficulties that secondary school students have when debugging in Python. We recommend that school teachers explicitly teach a systematic approach to debugging and discourage the use of ineffective debugging behaviours, and that programming environments should contain features that facilitate successful debugging.
翻译:背景与背景:调试是初学者程序员面临的一个重要且常令人沮丧的挑战。理解学生的调试行为和策略有助于识别常见困难,并指导缓解这些困难的方法。目前,对学生在基于文本的编程语言中调试行为的研究十分有限,而正是这种语言媒介,数以百万计的学生正在学习编程。目标:本文通过一项课堂长时段的实证研究,调查了12-14岁学生学习Python时的调试行为。方法:我们收集了73名学生在在线代码编辑器中完成一组Python调试练习时的程序快照。通过对这些快照的定性内容分析,我们开发了一套对学生调试过程中所作改变的细粒度分类。发现:尽管大多数学生能解决部分错误,但多数学生也频繁表现出无效的调试行为。许多学生通过小规模改动引入错误、撤销修正性更改,并短时间内反复运行同一程序。基于结果,我们识别出阻碍学生成功且可靠地调试基于文本编程语言的四个障碍:知识脆弱性、缺乏系统性和反思性、语法障碍、以及情绪与态度的动态影响。启示:本文强调了中学生在Python调试中面临的部分困难。我们建议学校教师明确教授系统化的调试方法,并杜绝无效调试行为;同时,编程环境应配备有助于成功调试的功能。