Program Comprehension and Code Complexity Metrics: An fMRI Study
The DOI matches its Crossref record; 21 of the 21 references it cites were found in a registry or an index.
Abstract
Background: Researchers and practitioners have been using code complexity metrics for decades to predict how developers comprehend a program. While it is plausible and tempting to use code metrics for this purpose, their validity is debated, since they rely on simple code properties and rarely consider particularities of human cognition. Aims: We investigate whether and how code complexity metrics reflect difficulty of program comprehension. Method: We have conducted a functional magnetic resonance imaging (fMRI) study with 19 participants observing program comprehension of short code snippets at varying complexity levels. We dissected four classes of code complexity metrics and their relationship to neuronal, behavioral, and subjective correlates of program comprehension, overall analyzing more than 41 metrics. Results: While our data corroborate that complexity metrics can-to a limited degree-explain programmers' cognition in program comprehension, fMRI allowed us to gain insights into why some code properties are difficult to process. In particular, a code's textual size drives programmers' attention, and vocabulary size burdens programmers' working memory. Conclusion: Our results provide neuro-scientific evidence supporting warnings of prior research questioning the validity of code complexity metrics and pin down factors relevant to program comprehension. Future Work: We outline several follow-up experiments investigating fine-grained effects of code complexity and describe possible refinements to code complexity metrics.
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
Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing
Benjamini, Y., & Hochberg, Y. (1995) · Journal of the Royal Statistical Society Series B: Statistical Methodology · doi:10.1111/j.2517-6161.1995.tb02031.x · Cited by 109,482
McCabe, T. J. (1976) · IEEE Transactions on Software Engineering · doi:10.1109/tse.1976.233837 · Cited by 6,059
Binder, J. R., Desai, R. H., Graves, W. W., & Conant, L. L. (2009) · Cerebral Cortex · doi:10.1093/cercor/bhp055 · Cited by 4,060
Mind over Machine: The Power of Human Intuition and Expertise in the Era of the Computer
Dreyfus, H. L., Drey-fus, S. E., & Zadeh, L. A. (1987) · IEEE Expert · doi:10.1109/mex.1987.4307079 · Cited by 3,172
On Broca, brain, and binding: A new framework
Hagoort, P. (2005) · Trends in Cognitive Sciences · doi:10.1016/j.tics.2005.07.004 · Cited by 1,411
Statistical Power Analysis for the Behavioral Sciences
Wassertheil, S., & Cohen, J. (1970) · Biometrics · doi:10.2307/2529115 · Cited by 1,383
A Parametric Manipulation of Factors Affecting Task-induced Deactivation in Functional Neuroimaging
McKiernan, K. A., Kaufman, J. N., Kucera-Thompson, J., & Binder, J. R. (2003) · Journal of Cognitive Neuroscience · doi:10.1162/089892903321593117 · Cited by 1,080
Lesion analysis of the brain areas involved in language comprehension
Dronkers, N. F., Wilkins, D. P., Van Valin, R. D., Redfern, B. B., & Jaeger, J. J. (2004) · Cognition · doi:10.1016/j.cognition.2003.11.002 · Cited by 1,035 · cited 1×
“BA 21 is typically associated with semantic processing during language comprehension [53], [54] and program comprehension [27].”
BackgroundTowards a theory of the comprehension of computer programs
Brooks, R. (1983) · International Journal of Man-Machine Studies · doi:10.1016/s0020-7373(83)80031-5 · Cited by 756 · cited 1×
“employing a more efficient top-down approach [31] is impeded, and because expertise can moderate the relationship between complexity and performance [7].”
MethodStimulus structures and mental representations in expert comprehension of computer programs
Pennington, N. (1987) · Cognitive Psychology · doi:10.1016/0010-0285(87)90007-7 · Cited by 526 · cited 1×
“Finally, consistent with previous studies [27], [28], we excluded all context information from snippets to enforce bottom-up comprehension [30].”
Result
Cited by
A survey on large language models for code generation
Jiang, J., Wang, F., Shen, J., Kim, S., & Kim, S. (2024) · arXiv · doi:10.48550/arxiv.2406.00515 · Cited by 257
A Survey on Large Language Models for Code Generation
Jiang, J., Wang, F., Shen, J., Kim, S., & Kim, S. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3747588 · Cited by 251
“The results revealed that the most successful LLM can achieve up to 47% of the benchmarks.”
How Readable is Model-generated Code? Examining Readability and Visual Inspection of GitHub Copilot
Al Madi, N. (2022) · Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering · doi:10.1145/3551349.3560438 · Cited by 50
“found that some source code metrics correlate with programmer cognition as measured by fMRI [15].”
BackgroundPeitek, N., Bergum, A., Rekrut, M., Mucke, J., Nadig, M., Parnin, C., Siegmund, J., & Apel, S. (2022) · Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering · doi:10.1145/3540250.3549084 · Cited by 32
“We started our search by selecting Java snippets from a variety of previous studies of program comprehension [13, 59, 73].”
BackgroundMethodSelf-citation
Metadata
- Authors
- Peitek, N., Apel, S., Parnin, C., Brechmann, A., & Siegmund, J.
- Venue
- 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)
- Publisher
- IEEE
- Published
- 2021-05
- Pages
- 524-536
- OpenAlex
- W3161285349
- Cited by
- 75
- References
- 21
- FWCI
- 10.28
- Type
- conference paper
- Language
- en
- Open access
- closed
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: Program Comprehension and Code Complexity Metrics: An fMRI Study. https://app.cochat.ai/papers/10.1109/icse43902.2021.00056
- The paper
- Peitek, N., Apel, S., Parnin, C., Brechmann, A., & Siegmund, J. (2021). Program Comprehension and Code Complexity Metrics: An fMRI Study. 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). https://doi.org/10.1109/icse43902.2021.00056
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.