The Role of Working Memory in Program Tracing
Will Crichton, Maneesh Agrawala, Pat Hanrahan
摘要
Program tracing, or mentally simulating a program on concrete inputs, is an important part of general program comprehension. Programs involve many kinds of virtual state that must be held in memory, such as variable/value pairs and a call stack. In this work, we examine the influence of short-term working memory (WM) on a person’s ability to remember program state during tracing. We first confirm that previous findings in cognitive psychology transfer to the programming domain: people can keep about 7 variable/value pairs in WM, and people will accidentally swap associations between variables due to WM load. We use a restricted focus viewing interface to further analyze the strategies people use to trace through programs, and the relationship of tracing strategy to WM. Given a straight-line program, we find half of our participants traced a program from the top-down line-by-line (linearly), and the other half start at the bottom and trace upward based on data dependencies (on-demand). Participants with an on-demand strategy made more WM errors while tracing straight-line code than with a linear strategy, but the two strategies contained an equal number of WM errors when tracing code with functions. We conclude with the implications of these findings for the design of programming tools: first, programs should be analyzed to identify and refactor human-memory-intensive sections of code. Second, programming environments should interactively visualize variable metadata to reduce WM load in accordance with a person’s tracing strategy. Third, tools for program comprehension should enable externalizing program state while tracing.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper3
- CrossCode: Multi-level Visualization of Program ExecutionDevamardeep Hayatpur, Daniel Wigdor, Haijun XiaCHI 2023 · 被引用 23 次
- Convergent Representations of Computer Programs in Human and Artificial Neural NetworksShashank Srikant, Ben Lipkin, Anna A. Ivanova, Evelina Fedorenko 等NeurIPS 2022 · 被引用 16 次
- High Expectations: An Observational Study of Programming and Cannabis IntoxicationWenxin He, Manasvi Parikh, Westley Weimer, Madeline EndresICSE 2024 · 被引用 2 次
相关 Paper
- Program Comprehension and Code Complexity Metrics: An fMRI StudyNorman Peitek, Sven Apel, Chris Parnin, André Brechmann 等ICSE 2021 · 被引用 59 次
- Developers' Visuo-spatial Mental Model and Program ComprehensionAbir Bouraffa, Gian-Luca Fuhrmann, Walid MaalejICSE 2023 · 被引用 1 次
- A Study of Change Blindness in Immersive EnvironmentsDaniel Martin, Xin Sun, Diego Gutierrez, Belén MasiáIEEE VR 2023 · 被引用 17 次
- "Get Me in the Groove": a Mixed Methods Study on Supporting Adhd Professional ProgrammersKaia Newman, Sarah Snay, Madeline Endres, Manasvi Parikh 等ICSE 2025 · 被引用 3 次
- Correlates of programmer efficacy and their link to experience: a combined EEG and eye-tracking studyNorman Peitek, Annabelle Bergum, Maurice Rekrut, Jonas Mucke 等FSE 2022 · 被引用 28 次
