🤖 AI Summary
This study investigates the visual attention mechanisms employed by programmers when localizing memory-related bugs—specifically memory leaks, buffer overflows, and double frees—in C code. Using eye-tracking, source-code interaction logging, and qualitative coding, we analyzed gaze patterns across code lines and functions during 17 hours of debugging tasks performed by 11 professional programmers. We present the first systematic empirical characterization of attention distribution in memory bug localization: successful debuggers consistently fixate earlier on memory operation contexts and boundary-condition logic, whereas unsuccessful ones linger on syntactically correct but semantically suspicious regions. Crucially, function-level attention concentration exhibits a statistically significant positive correlation with debugging success. These findings provide empirical grounding for understanding the cognitive processes underlying program debugging and offer human-centered design principles for next-generation intelligent debugging tools—particularly those incorporating attention-aware prioritization or visualization features.
📝 Abstract
This paper presents a study of human visual attention during localization of memory bugs in C. Human visual attention refers to the mechanical processes by which we selectively process and prioritize information. Visual attention is important to study because it is central to what information people (who are sighted) use to solve a particular problem. Meanwhile, memory bugs are among the most common types of bugs in C programs that manifest as a variety of program faults. In this paper, we study human visual attention while people attempt to locate memory bugs in code. We recruit 11 programmers to locate between one and six memory bugs in three C programs for 1.5-2 hours each. In total we collected observations of 17 hours of programmer effort. The bugs in our study cover memory leaks, overflows, and double frees, which are among the most common memory bugs. We analyze the task outcomes in terms of success rate and related factors, patterns of visual attention overall such as what lines and functions are read, and finally we explore differences of visual attention patterns during success versus failure cases.