Eye-Tracking Insights into the Effects of Type Annotations and Identifier Naming
Publisher DOI
Abstract
Understanding and modifying source code is a cognitively demanding task shaped by how the code is structured and presented. Prior work has shown that both identifier naming and type annotations can influence program comprehension, yet findings on their in dividual effects remain mixed. This study focuses on how these two aspects interact in influencing program comprehension, visual attention, and subjective perceptions of code comprehensibility. We conducted a controlled eye-tracking experiment with 40 participants who were asked to understand 20 Python code snippets. Our results reveal an interesting dichotomy between objective and subjective findings. Objectively, type annotations slightly slow down developers, but otherwise have almost no statistically significant effect on behavior, visual attention, or subjective perceptions, even when combining them with the meaningfulness of identifier naming. Subjectively, however, nearly all participants felt that type annotations helped with program comprehension. Overall, our findings suggest that type annotations—and their interaction with identifier names—do not generally introduce measurable overhead, but depending on the code snippet and individual participant, may increase developers’ sense of certainty and clarity.
Date Issued
2026-04
Publication Type
Conference Item
Language(s)
en
Author(s)
Peitek, Norman | |
Abdelsalam, Youssef | |
Bergum, Annabelle | Saarland University |
Wyrich, Marvin | |
Apel, Sven |
Additional Credits
Title of Event
Access(Rights)
open.access