The evolution of type annotations in python: an empirical study
Luca Di Grazia, Michael Pradel
摘要
Type annotations and gradual type checkers attempt to reveal errors and facilitate maintenance in dynamically typed programming languages. Despite the availability of these features and tools, it is currently unclear how quickly developers are adopting them, what strategies they follow when doing so, and whether adding type annotations reveals more type errors. This paper presents the first large-scale empirical study of the evolution of type annotations and type errors in Python. The study is based on an analysis of 1,414,936 type annotation changes, which we extract from 1,123,393 commits among 9,655 projects. Our results show that (i) type annotations are getting more popular, and once added, often remain unchanged in the projects for a long time, (ii) projects follow three evolution patterns for type annotation usage -- regular annotation, type sprints, and occasional uses -- and that the used pattern correlates with the number of contributors, (iii) more type annotations help find more type errors (0.704 correlation), but nevertheless, many commits (78.3%) are committed despite having such errors. Our findings show that better developer training and automated techniques for adding type annotations are needed, as most code still remains unannotated, and they call for a better integration of gradual type checking into the development process.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper10
- PyTy: Repairing Static Type Errors in PythonYiu Wai Chow, Luca Di Grazia, Michael PradelICSE 2024 · 被引用 13 次
- DyPyBench: A Benchmark of Executable Python SoftwareIslem Bouzenia, Bajaj Piyush Krishan, Michael PradelFSE 2024 · 被引用 8 次
- Are Prompt Engineering and TODO Comments Friends or Foes? An Evaluation on GitHub CopilotDavid O'Brien, Sumon Biswas, Sayem Mohammad Imtiaz, Rabe Abdalkareem 等ICSE 2024 · 被引用 7 次
- Towards Effective Static Type-Error Detection for PythonWonseok Oh, Hakjoo OhASE 2024 · 被引用 1 次
- DyLin: A Dynamic Linter for PythonAryaz Eghbali, Felix Burk, Michael PradelFSE 2025 · 被引用 1 次
它引用的顶会 Paper8
- Freezing the Web: A Study of ReDoS Vulnerabilities in JavaScript-based Web ServersCristian-Alexandru Staicu, Michael PradelUSENIX Security 2018 · 被引用 125 次
- TypeWriter: neural type prediction with search-based validationMichael Pradel, Georgios Gousios, Jason Liu, Satish ChandraFSE 2020 · 被引用 102 次
- Typilus: neural type hintsMiltiadis Allamanis, Earl T. Barr, Soline Ducousso, Zheng GaoPLDI 2020 · 被引用 92 次
- CodeShovel: Constructing Method-Level Source Code HistoriesFelix Grund, Shaiful Alam Chowdhury, Nick C. Bradley, Braxton Hall 等ICSE 2021 · 被引用 33 次
- DynaPyt: a dynamic analysis framework for PythonAryaz Eghbali, Michael PradelFSE 2022 · 被引用 30 次
相关 Paper
- Where to Start: Studying Type Annotation Practices in PythonWuxia Jin, Dinghong Zhong, Zifan Ding, Ming Fan 等ASE 2021 · 被引用 10 次
- Taming type annotations in gradual typingJohn Peter Campora III, Sheng ChenOOPSLA 2020 · 被引用 7 次
- Typed and Confused: Studying the Unexpected Dangers of Gradual TypingDominic Troppmann, Aurore Fass, Cristian-Alexandru StaicuASE 2024 · 被引用 2 次
- Automating Just-In-Time Python Type Annotation UpdatingZhipeng Xue, Zhipeng Gao, Xing Hu, Jingyuan Chen 等ICSE 2026
- Understanding type changes in JavaAmeya Ketkar, Nikolaos Tsantalis, Danny DigFSE 2020 · 被引用 17 次
