Understanding and Teaching Debugging in Software Engineering: From Professional Practice to Student Learning
- Li, Haolin
- Advisor(s): Coblenz, Michael
Abstract
Debugging is a central yet complex activity in software engineering, yet it remains difficult to understand and teach. Prior research has documented debugging strategies and tool use, but less is known about how experienced developers reason about bugs in large, real-world codebases, or how such process-level knowledge can inform instruction. To develop a theory of how professionals debug, we conducted a grounded theory study of seven professional developers and five professional live-coding streamers working on 17 debugging tasks in their own codebases. From observing these developers, we theorize debugging as a structured, iterative diagnostic process in which programmers update a mental model of the system to guide information gathering. The way developers gather within and outside of the codebase varies according to codebase context, complexity, familiarity, and changes to the mental model they are constructing and updating. Because these findings suggest that debugging expertise depends not only on techniques but also on process regulation, we transformed the professional theory into instructional scaffolds for two strategies: backward tracing (BT) and hypothesis testing (HT). We assigned students to use the two strategies in a random order to fix two of six different bugs during a three-hour session, gathering qualitative and quantitative data on their experience and performance. In general, students shared that both debugging strategies were useful, with a slight preference for BT over the HT approach. Student self-reports indicated that many of them combined the two strategies while working on the debugging tasks, or shared in their reflections that BT and HT were useful in different contexts or preferred using them in combination. Across both studies, this dissertation argues that debugging is best understood and taught as an iterative process of evidence gathering and mental model update rather than as a collection of isolated techniques. It contributes a grounded theory of professional debugging, a pedagogical translation of that theory into process-oriented scaffolds, and empirical evidence on how students use and reflect on those scaffolds in software engineering education.