{"id":88650,"date":"2024-10-15T09:48:01","date_gmt":"2024-10-15T08:48:01","guid":{"rendered":"https:\/\/www.raspberrypi.org\/?p=88650"},"modified":"2025-12-02T13:40:58","modified_gmt":"2025-12-02T13:40:58","slug":"debugging-positive-experience-secondary-school-students","status":"publish","type":"post","link":"https:\/\/www.raspberrypi.org\/blog\/debugging-positive-experience-secondary-school-students\/","title":{"rendered":"How to make debugging a positive experience for secondary school students"},"content":{"rendered":"\n

Artificial intelligence (AI) continues to change many areas of our lives, with new AI technologies and software having the potential to significantly impact the way programming is taught at schools. In our seminar series this year, we\u2019ve already heard about new AI code generators<\/a> that can support and motivate young people when learning to code, AI tools that can create personalised Parson\u2019s Problems<\/a>, and research into how generative AI could improve young people\u2019s understanding of program error messages<\/a>.<\/p>\n\n\n

\n
\"Two<\/figure>\n<\/div>\n\n\n

At times, it can seem like everything is being automated with AI. However, there are some parts of learning to program that cannot (and probably should not) be automated, such as understanding errors in code and how to fix them. Manually typing code might not be necessary in the future, but it will still be crucial to understand the code that is being generated and how to improve and develop it. <\/p>\n\n\n\n

As important as debugging might be for the future of programming, it\u2019s still often the task most disliked by novice programmers. Even if program error messages can be explained in the future or tools like LitterBox can flag bugs in an engaging way, actually fixing<\/strong> the issues involves time, effort, and resilience \u2014 which can be hard to come by at the end of a computing lesson in the late afternoon with 30 students crammed into an IT room. <\/p>\n\n\n

\n
\"\"
Debugging can be challenging in many different ways and it is important to understand why students struggle to be able to support them better.<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n

But what is it about debugging that young people find so hard, even when they\u2019re given enough time to do it? And how can we make debugging a more motivating experience for young people? These are two of the questions that Laurie Gale, a PhD student at the Raspberry Pi Computing Education Research Centre, focused on in our July seminar.<\/p>\n\n\n\n

Why do students find debugging hard?<\/h2>\n\n\n\n

Laurie has spent the past two years talking to teachers and students and developing tools (a visualiser of students’ programming behaviour<\/a> and PRIMMDebug<\/a>, a teaching process and tool for debugging) to understand why many secondary school students struggle with debugging. It has quickly become clear through his research that most issues are due to problematic debugging strategies and students\u2019 negative experiences and attitudes.<\/p>\n\n\n

\n
\"A
When Laurie Gale started looking into debugging research for his PhD, he noticed that the majority of studies had been with college students, so he decided to change that and find out what would make debugging easier for novice programmers at secondary school.<\/em>
<\/figcaption><\/figure>\n<\/div>\n\n\n

When students first start learning how to program, they have to remember a vast amount of new information, such as different variables, concepts, and program designs. Utilising this knowledge is often challenging because they\u2019re already busy juggling all the content they\u2019ve previously learnt and the challenges of the programming task at hand. When error messages inevitably appear that are confusing or misunderstood, it can become extremely difficult to debug effectively. <\/p>\n\n\n

\n
\"\"
Program error messages are usually not tailored to the age of the programmers and can be hard to understand and overwhelming for novices.<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n

Given this information overload, students often don\u2019t develop efficient strategies for debugging. When Laurie analysed the debugging efforts of 12- to 14-year-old secondary school students, he noticed some interesting differences between students who were more and less successful at debugging. While successful students generally seemed to make less frequent and more intentional changes, less successful students tinkered frequently with their broken programs, making one- or two-character edits before running the program again. In addition, the less successful students often ran the program soon after beginning the debugging exercise without allowing enough time to actually read the code and understand what it was meant to do. <\/p>\n\n\n\n

The issue with these behaviours was that they often resulted in students adding errors<\/strong> when changing the program, which then compounded and made debugging increasingly difficult with each run. 74% of students also resorted to spamming, pressing \u2018run\u2019 again and again without changing anything. This strategy resonated with many of our seminar attendees, who reported doing the same thing after becoming frustrated. <\/p>\n\n\n\n

Educators need to be aware of the negative consequences of students\u2019 exasperating and often overwhelming experiences with debugging, especially if students are less confident in their programming skills to begin with. Even though spending 15 minutes on an exercise shows a remarkable level of tenaciousness and resilience, students\u2019 attitudes to programming \u2014 and computing as a whole \u2014 can quickly go downhill if their strategies for identifying errors prove ineffective. Debugging becomes a vicious circle: if a student has negative experiences, they are less confident when having to bug-fix again in the future, which can lead to another set of unsuccessful attempts, which can further damage their confidence, and so on. Avoiding this downward spiral is essential. <\/p>\n\n\n\n

Approaches to help students engage with debugging<\/h2>\n\n\n\n

Laurie stresses the importance of understanding the cognitive challenges of debugging and using the right tools and techniques to empower students and support them in developing effective strategies.<\/p>\n\n\n

\n
\"\"
To make debugging a less cognitively demanding activity, Laurie recommends using a range of tools and strategies in the classroom.<\/em><\/figcaption><\/figure>\n<\/div>\n\n\n

Some ideas of how to improve debugging skills that were mentioned by Laurie and our attendees included:<\/p>\n\n\n\n