Do Developers Read Type Information? An Eye-Tracking Study on TypeScript

πŸ“… 2026-02-04
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This study investigates whether developers actually use type annotations as inline documentation during code comprehension and debugging. Through an eye-tracking experiment with 26 undergraduate participants performing code summarization and bug localization tasks on TypeScript code, the research examines visual attention to type-annotated lines. As the first empirical study employing eye tracking to assess developers’ engagement with static type information, the findings reveal that participants did not significantly fixate more on code lines containing type annotations, thereby challenging the widely held assumption that type annotations inherently serve as effective documentation. These results carry important implications for the design of programming tools and the pedagogy of type systems.

Technology Category

Application Category

πŸ“ Abstract
Statically-annotated types have been shown to aid developers in a number of programming tasks, and this benefit holds true even when static type checking is not used. It is hypothesized that this is because developers use type annotations as in-code documentation. In this study, we aim to provide evidence that developers use type annotations as in-code documentation. Understanding this hypothesized use will help to understand how, and in what contexts, developers use type information; additionally, it may help to design better development tools and inform educational decisions. To provide this evidence, we conduct an eye tracking study with 26 undergraduate students to determine if they read type annotations during code comprehension and bug localization in the TypeScript language. We found that developers do not look directly at lines containing type annotations or type declarations more often when they are present, in either code summarization or bug localization tasks. The results have implications for tool builders to improve the availability of type information, the development community to build good standards for use of type annotations, and education to enforce deliberate teaching of reading patterns.
Problem

Research questions and friction points this paper is trying to address.

type annotations
code comprehension
eye-tracking
TypeScript
developer behavior
Innovation

Methods, ideas, or system contributions that make the work stand out.

eye-tracking
TypeScript
type annotations
code comprehension
developer behavior
πŸ”Ž Similar Papers