paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Program Comprehension and Code Complexity Metrics: An fMRI Study

程序理解与代码复杂度度量:一项 fMRI 研究
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 1/10 · 该论文通过 fMRI 研究代码复杂度度量与程序理解难度的关系,属于软件工程中的认知实证研究,与用户关注的 PL/AI 交叉、静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析均无直接关联。引用 91 inbox
Norman Peitek, Sven Apel, Chris Parnin, Andre Brechmann, Janet Siegmund
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:用 fMRI 研究检验代码复杂度度量能否反映程序理解难度,并揭示文本规模与词汇量的认知影响。

论文关注代码复杂度度量能否预测开发者理解程序的难度。作者对19名被试进行功能磁共振成像(fMRI)实验,让其理解不同复杂度的短代码片段,系统分析四类、共41余种代码复杂度度量与神经、行为和主观指标的关系。结果显示,复杂度度量只能有限地解释程序理解中的认知活动;fMRI进一步揭示,代码的文本规模主要驱动注意,词汇量则加重工作记忆负担。作者认为这为质疑复杂度度量有效性的先前研究提供了神经科学证据,并定位了影响程序理解的关键因素,同时提出后续细粒度实验与度量改进方向。

问题
代码复杂度度量长期被用于预测程序理解难度,但其有效性受到质疑,因为它们依赖简单代码属性,较少考虑人类认知特点。
方法
开展 fMRI 实验,让19名被试理解不同复杂度的短代码片段,并将四类、超过41种复杂度度量与神经、行为及主观理解指标进行关联分析。
评估
实验结果表明复杂度度量仅能有限解释程序理解中的认知活动,且文本规模与词汇量分别关联注意和工作记忆,为度量有效性警告提供神经科学证据。
原文摘要(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.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{PeitekAPBS21,
  title = {Program Comprehension and Code Complexity Metrics: An fMRI Study},
  author = {Norman Peitek and Sven Apel and Chris Parnin and Andre Brechmann and Janet Siegmund},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00056}
}