一句话:提出首个基于 ACT-R 的代码阅读认知仿真框架,用少量眼动数据模拟人类视觉注意扫描路径。
阅读代码是软件工程与计算机科学教育中的基本活动,理解其背后的认知过程有助于识别有效的认知策略,进而改进教学方法与开发者工具支持。然而,面向编程任务的大规模人类眼动数据采集往往成本高昂、耗时巨大,限制了研究的可扩展性与适用性。为此,本文提出 CodeACT-R——首个专为代码阅读定制的认知仿真框架,它以认知科学中成熟的 ACT-R(Adaptive Control of Thought—Rational)架构为基础。作者首先采集了 48 名程序员阅读代码时的真实视觉注意数据,并据此设计并标定仿真器,使其仅需少量可控的人类数据即可启动。评估表明,CodeACT-R 能够生成与真实人类视觉注意模式高度相似的扫描路径,并可解释多达 87% 的观察模式变化,为传统眼动数据采集提供了一种低成本、可扩展的替代方案。
Reading code is a fundamental activity in both software engineering and computer science education. Understanding the cognitive processes involved in reading code is crucial for identifying effective cognitive strategies, which can inform teaching methods and tooling support for developers. However, collecting large human subject eye tracking datasets, especially for programming tasks, is often costly and time-consuming, limiting its scalability and applicability. To address this issue, we present CodeACT-R, the first cognitive simulation framework tailored for code reading, based on the well-established Adaptive Control of Thought—Rational (ACT-R) architecture from cognitive science. CodeACT-R simulates how humans read code and requires only a small, manageable amount of human data to initiate the simulator design, offering a cost-effective and scalable alternative to traditional data collection methods like eye tracking.Specifically, we first collected real human visual attention data from 48 programmers reading code using eye tracking. These data were then used to develop CodeACT-R, enabling the simulation of human-like code reading behaviors. Our evaluation demonstrates that CodeACT-R is capable of simulating visual attention patterns (i.e., scanpaths) that closely resemble real-world human attention patterns, also accounting for up to 87% of observed pattern variations.
DOI 原文 ·
@inproceedings{paperbot9416,
title = {CodeACT-R: A Cognitive Simulation Framework for Human Attention in Code Reading},
author = {Yueke Zhang and Zihan Fang and Greg Trafton and Daniel Levin and Kevin Leach and Yu Huang},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00333}
}