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

Published: (February 4, 2026 at 01:12 PM EST)
3 min read
Source: arXiv

Source: arXiv - 2602.04824v1

Overview

This paper investigates whether developers actually read type annotations while working with TypeScript code. By tracking the eye movements of 26 undergraduate programmers during code‑summarization and bug‑localization tasks, the authors provide empirical evidence that type information is often ignored, even though prior research suggests that static types can aid comprehension.

Key Contributions

  • Empirical eye‑tracking study on real‑world TypeScript code with a sizable participant pool (26 students).
  • Quantitative evidence that developers rarely fixate on lines containing type annotations during both summarization and bug‑finding tasks.
  • Insightful discussion of how the observed reading patterns affect tool design, coding standards, and programming education.
  • Open data and analysis scripts (released by the authors) to enable replication and further research.

Methodology

  1. Participants – 26 undergraduate students with basic TypeScript experience.
  2. Tasks
    • Code summarization: participants read a function and wrote a short natural‑language description.
    • Bug localization: participants identified the line responsible for a seeded defect.
  3. Materials – Four TypeScript snippets (two with explicit type annotations, two without) drawn from open‑source projects.
  4. Eye‑tracking setup – A Tobii eye‑tracker recorded gaze points at 60 Hz. Fixations were mapped to source‑code tokens, allowing the researchers to compute the proportion of time spent looking at type‑related tokens versus other code.
  5. Analysis – Statistical comparison (paired t‑tests and mixed‑effects models) of fixation counts on type‑annotation lines versus non‑type lines across tasks.

Results & Findings

  • Low fixation rates: On average, participants looked at type‑annotation lines less than 10 % of the time they spent on the surrounding code.
  • No task‑dependent increase: The presence of a bug did not cause developers to glance more at type information.
  • Summarization vs. bug‑localization: Both tasks showed similar patterns; developers relied primarily on the body of the function, not on its type signatures.
  • Statistical significance: The differences in fixation counts between type‑annotated and non‑annotated lines were statistically significant (p < 0.01) across all conditions.

Practical Implications

  • Tool builders: IDEs could surface type information more proactively (e.g., hover pop‑ups, inline hints) rather than assuming developers will read the annotations themselves.
  • Code review & documentation: Teams might treat type signatures as metadata rather than primary documentation, encouraging complementary comments or design docs.
  • Coding standards: Projects could adopt conventions that place the most critical information (e.g., naming, comments) in the function body, reserving types for static checking only.
  • Education: Curricula should explicitly teach students how to leverage types—perhaps via exercises that require reading and interpreting type signatures—rather than assuming the skill will develop organically.
  • Static analysis tools: Since developers often ignore types, tools that automatically surface type‑related warnings or suggestions could be more valuable than static checks that merely rely on the presence of annotations.

Limitations & Future Work

  • Participant pool: All subjects were undergraduates; professional developers might exhibit different reading habits.
  • Task scope: Only two task types (summarization and bug localization) were examined; other activities like refactoring or API design could yield different results.
  • Language focus: Findings are specific to TypeScript; languages with richer type systems (e.g., Rust, Haskell) may encourage more type‑centric reading.
  • Future directions: Extending the study to industry practitioners, exploring the impact of richer IDE support for types, and investigating whether training interventions can shift reading patterns.

Authors

  • Samuel W. Flint
  • Robert Dyer
  • Bonita Sharif

Paper Information

  • arXiv ID: 2602.04824v1
  • Categories: cs.SE
  • Published: February 4, 2026
  • PDF: Download PDF
Back to Blog

Related posts

Read more »