The DOI matches its Crossref record; 35 of the 36 references it cites were found in a registry or an index.
The Role of Working Memory in Program Tracing
Open accessAbstract
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
The magical number seven, plus or minus two: Some limits on our capacity for processing information.
Miller, G. A. (1994) · Psychological Review · doi:10.1037/0033-295x.101.2.343 · Cited by 17,161
Hutchins, E. (1995) · doi:10.7551/mitpress/1881.001.0001 · Cited by 10,801 · cited 1×
“Consistent with the theory of distributed cognition [18], code comprehension tools should consider how to enable programmers to externalize their thought process to the environment without needing to print out code.”
BackgroundThe magical number 4 in short-term memory: A reconsideration of mental storage capacity
Cowan, N. (2001) · Behavioral and Brain Sciences · doi:10.1017/s0140525x01003922 · Cited by 6,779 · cited 1×
“The universal limitations of WM have been studied since the early days of cognitive psychology [23]: WM has a capacity of roughly 4 ± 1 chunks [9], and chunks are forgotten”
BackgroundCousot, P., & Cousot, R. (1977) · Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages - POPL '77 · doi:10.1145/512950.512973 · Cited by 6,279 · cited 2×
“We focused on tracing with concrete inputs and outputs, but one can imagine tracing over symbolic values, akin to the method of abstract interpretation in static analysis [8].”
MethodIncreasing Transparency Through a Multiverse Analysis
Steegen, S., Tuerlinckx, F., Gelman, A., & Vanpaemel, W. (2016) · Perspectives on Psychological Science · doi:10.1177/1745691616658637 · Cited by 1,372 · cited 1×
“This number was selected by inspecting the noise in the data, but in the spirit of multiverse analysis [30] we confrmed that all signifcant results still hold with p < 0.”
MethodThe Case for Motor Involvement in Perceiving Conspecifics.
Wilson, M., & Knoblich, G. (2005) · Psychological Bulletin · doi:10.1037/0033-2909.131.3.460 · Cited by 818 · cited 1×
“However, cognitive psychologists have repeatedly demonstrated the close relationship between action and understanding in comprehension of language [28] and gestures [34].”
BackgroundMemory updating in working memory: The role of the central executive
Morris, N., & Jones, D. M. (1990) · British Journal of Psychology · doi:10.1111/j.2044-8295.1990.tb02349.x · Cited by 734 · cited 1×
“The cognitive action of updating WM in a running memory task is coordinated by central executive WM [24], therefore we hypothesize that participants should have a lower efective WM capacity for variable/value pairs than in the prior experiment.”
ResultCognitive dimensions of notations
Green, T. R. G. (1990) · Cited by 645
Do people use language production to make predictions during comprehension?
Pickering, M. J., & Garrod, S. (2007) · Trends in Cognitive Sciences · doi:10.1016/j.tics.2006.12.002 · Cited by 642 · cited 1×
“However, cognitive psychologists have repeatedly demonstrated the close relationship between action and understanding in comprehension of language [28] and gestures [34].”
BackgroundProgram comprehension during software maintenance and evolution
Von Mayrhauser, A., & Vans, A. M. (1995) · Computer · doi:10.1109/2.402076 · Cited by 575 · cited 2×
“However, most popular models of program comprehension focus largely on schemata/plans as a mechanism of comprehension, e.g. the seven models in the survey of von Mayrhauser and Vans[33].”
Method
Research works printed but not linked: 1
- Alan Baddeley. 2010. Working memory. Current biology 20, 4 (2010), R136–R140.
Cited by
Prather, J., Reeves, B. N., Denny, P., Becker, B. A., Leinonen, J., Luxton-Reilly, A., Powell, G., Finnie-Ansley, J., & Santos, E. A. (2024) · ACM Transactions on Computer-Human Interaction · doi:10.1145/3617367 · Cited by 256
“One example of a programming activity that includes both the cognitive and metacognitive aspects is code tracing with concrete inputs, something constrained to working memory [28].”
BackgroundCrossCode: Multi-level Visualization of Program Execution
Hayatpur, D., Wigdor, D., & Xia, H. (2023) · CHI Conference on Human Factors in Computing Systems · doi:10.1145/3544548.3581390 · Cited by 42
“…the effects of tracing on working memory, Crichton et al. found two primary strategies: linear tracing following the control flow from the beginning to the end, or on-demand tracing, starting from the end with variables of interest and tracing back through the code that affected the variable [12].”
BackgroundBlocklyVR: Exploring Block-based Programming in Virtual Reality
Hedlund, M., Jonsson, A., Bogdan, C., Meixner, G., Ekblom‐Bak, E., & Matviienko, A. (2023) · International Conference on Mobile and Ubiquitous Multimedia (MUM) · doi:10.1145/3626705.3627779 · Cited by 28
RustViz: Interactively Visualizing Ownership and Borrowing
Almeida, M., Cole, G., Du, K., Luo, G., Pan, S., Pan, Y., Qiu, K., Reddy, V., Zhang, H., Zhu, Y., et al. (2022) · IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC) · doi:10.1109/vl/hcc53370.2022.9833121 · Cited by 12
“Based on the studies above, we identified the key challenge: the user must learn to mentally simulate the logic of the borrow checker, which is known to be challenging [17–19].”
BackgroundBarriers in Front-End Web Development
Samudio, D. I., & LaToza, T. D. (2022) · IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC) · doi:10.1109/vl/hcc53370.2022.9833127 · Cited by 12
“Previous studies have shown that developers struggle recognizing the concepts they commonly use [36], and remembering vast amounts of details as they determine the behavior of their code [46].”
Background
Metadata
- Authors
- Crichton, W., Agrawala, M., & Hanrahan, P.
- Affiliations
- Stanford University (US)
- Venue
- Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems
- Publisher
- ACM
- Published
- 2021-05-06
- Pages
- 1-13
- OpenAlex
- W3124089355
- Cited by
- 13
- References
- 36
- Citations by year
- 2026: 1 · 2024: 2 · 2023: 5 · 2022: 3 · 2021: 2
- FWCI
- 2.49
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- CHI Conference on Human Factors in Computing Systems (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
- Physical Sciences › Computer Science › Computer Graphics and Computer-Aided Design › Data Visualization and Analytics
- Keywords
- program tracing, working memory, program comprehension, short-term memory capacity, data dependencies, call stack, programming environment design
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
How to cite
Cite CoChat for the checks on this page, and the paper for its own findings.
- This page
- CoChat. (2026). Citation check: The Role of Working Memory in Program Tracing. https://app.cochat.ai/papers/10.1145/3411764.3445257
- The paper
- Crichton, W., Agrawala, M., & Hanrahan, P. (2021). The Role of Working Memory in Program Tracing. Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems. https://doi.org/10.1145/3411764.3445257
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.