>

Investigating the Feasibility of Conducting Webcam-Based Eye-Tracking Studies in Code Comprehension

Fang, Zihan; Wallace, Robert; Karas, Zachary; Li, Toby Jia Jun; McMillan, Collin; & Huang, Yu. (2026). Investigating the feasibility of conducting webcam-based eye-tracking studies in code comprehensionIEEE Transactions on Software Engineering. Advance online publication. https://doi.org/10.1109/TSE.2026.3651615

Software Engineering (SE) researchers often use eye-tracking experiments to study how programmers visually process code during tasks such as code comprehension. Traditionally, these studies use research-grade screen-mounted eye trackers in controlled laboratory settings. However, during the pandemic and due to challenges in recruiting participants—especially those with specialized SE expertise—researchers increasingly began conducting offsite studies using webcam-based eye trackers that allow participants to complete tasks in their natural environments.

This study compares the performance of a webcam-based eye tracker with a traditional research-grade screen-mounted eye tracker in code comprehension tasks. In onsite experiments, 49 participants used both types of eye trackers at the same time. This allowed the researchers to directly compare how well the webcam-based system captured visual attention patterns at different levels: general viewing behavior, semantic-level understanding (such as focusing on meaningful code structures), and token-level detail (individual symbols or keywords). The study also examined whether the webcam-based tracker could detect differences between individuals. In addition, 10 participants completed offsite experiments to evaluate performance in real-world conditions.

The results show that the webcam-based eye tracker can reasonably capture programmers’ semantic comprehension patterns but struggles to accurately detect more fine-grained token-level cognitive patterns, especially in onsite comparisons. In offsite settings, increased noise and environmental variability further reduced reliability. Participants also experienced difficulties with calibration and starting tasks, highlighting practical challenges in remote eye-tracking studies.

Overall, this study evaluates the feasibility of webcam-based eye tracking in Software Engineering research, identifies current limitations, and provides guidance for improving the design and accuracy of future remote eye-tracking studies.