Predicting Code Comprehension: A Novel Approach to Align Human Gaze with Code using Deep Neural Networks

Author:

Alakmeh Tarek1ORCID,Reich David2ORCID,Jäger Lena1ORCID,Fritz Thomas1ORCID

Affiliation:

1. University of Zurich, Zurich, Switzerland

2. University of Potsdam, Zurich, Germany

Abstract

The better the code quality and the less complex the code, the easier it is for software developers to comprehend and evolve it. Yet, how do we best detect quality concerns in the code? Existing measures to assess code quality, such as McCabe’s cyclomatic complexity, are decades old and neglect the human aspect. Research has shown that considering how a developer reads and experiences the code can be an indicator of its quality. In our research, we built on these insights and designed, trained, and evaluated the first deep neural network that aligns a developer’s eye gaze with the code tokens the developer looks at to predict code comprehension and perceived difficulty. To train and analyze our approach, we performed an experiment in which 27 participants worked on a range of 16 short code comprehension tasks while we collected fine-grained gaze data using an eye tracker. The results of our evaluation show that our deep neural sequence model that integrates both the human gaze and the stimulus code, can predict (a) code comprehension and (b) the perceived code difficulty significantly better than current state-of-the-art reference methods. We also show that aligning human gaze with code leads to better performance than models that rely solely on either code or human gaze. We discuss potential applications and propose future work to build better human-inclusive code evaluation systems.

Publisher

Association for Computing Machinery (ACM)

Reference83 articles.

1. 2024. Supplementary Material. https://zenodo.org/doi/10.5281/zenodo.11123100

2. Harold Abelson, Gerald Jay Sussman, and Julie Sussman. 1996. Structure and Interpretation of Computer Programs. The MIT Press, Cambridge. isbn:9780262510875

3. From Novice to Expert: Analysis of Token Level Effects in a Longitudinal Eye Tracking Study

4. Determining Differences in Reading Behavior Between Experts and Novices by Investigating Eye Movement on Source Code Constructs During a Bug Fixing Task

5. Expertise-dependent visual attention strategies develop over time during debugging with multiple code representations

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3