
Ph.D. Thesis Defense: Samuel Flint
Monday, July 28, 2025
12:00 PM
Join Zoom Meeting: https://unl.zoom.us/j/94048454607
"How Developers Use Type-System Related Programming Language Features"
Optional type annotations are a popular feature of programming languages that allow developers to omit explicit type information in code while, in some cases, retaining many of the benefits of static typing, such as in-code documentation, improved detection of type errors, or enforcement of code properties. However, how developers use and understand optional type annotations is not clear. The focus of this dissertation is to understand the use and comprehension of optional type annotations.
Optional type annotations are examined through four lenses: first, by examining the evolution of usage in a statically typed programming language (Kotlin, the default language for Android), we find that locations tend to retain their annotation (or lack thereof) over time, and some locations such as initialized class fields and single-expression method return types receive type annotations more frequently than others.
Second, by examining the output of large language models (LLMs) for the presence of type annotations when generating code, we find differing behavior between languages, with Python being minimally annotated unless explicitly requested. But explicitly requesting types also leads to more syntax errors.
Third, by using eye tracking to better understand developer reference behavior (such as looking back at a line containing a declaration) with respect to type annotations, we find that developers did not engage in reference behavior more frequently in code with type annotations.
Finally, through direct intervention, asking developers why they made a particular change to a type annotation, we find the three most common reasons type annotations are modified (or added/removed) are due to an incorrect type causing an error, to improve their function as documentation, or to adhere to a formal convention.
Together, this confirms that developers view type annotations as documentation, especially in certain locations, even if they are rarely modified. However, how this information gets utilized by other developers or LLMs is unclear: we do not see evidence that developers refer to it during bug localization, and we see that requesting type annotations can cause downstream problems for popular tools such as LLMs.
Committee:
Dr. Robert Dyer, Advisor
Dr. Bonita Sharif
Dr. Hamid Bagheri
Dr. Jason Hawkins, External Member