Mining Type Constructs Using Patterns in AI-Generated Code
Imgyeong Lee, Tayyib Ul Hassan, Abram Hindle

TL;DR
This paper empirically analyzes AI-generated TypeScript code, revealing AI's tendencies to misuse type constructs but also showing higher acceptance rates for AI-involved pull requests.
Contribution
First systematic empirical study comparing AI and human use of type constructs in TypeScript, highlighting AI's overuse of 'any' and advanced types.
Findings
AI agents are 9x more prone to use 'any' keyword.
AI agents use advanced type constructs more often than humans.
AI-involved pull requests have 1.8x higher acceptance rates.
Abstract
Artificial Intelligence (AI) increasingly automates various parts of the software development tasks. Although AI has enhanced the productivity of development tasks, it remains unstudied whether AI essentially outperforms humans in type-related programming tasks, such as employing type constructs properly for type safety, during its tasks. Moreover, there is no systematic study that evaluates whether AI agents overuse or misuse the type constructs under the complicated type systems to the same extent as humans. In this study, we present the first empirical analysis to answer these questions in the domain of TypeScript projects. Our findings show that, in contrast to humans, AI agents are 9x more prone to use the 'any' keyword. In addition, we observed that AI agents use advanced type constructs, including those that ignore type checks, more often compared to humans. Surprisingly, even…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
