To Type or Not to Type? A Systematic Comparison of the Software Quality of JavaScript and TypeScript Applications on GitHub
Justus Bogner, Manuel Merkel

TL;DR
This study empirically compares JavaScript and TypeScript applications on GitHub across multiple quality metrics, revealing that TypeScript improves code quality and understandability but does not significantly reduce bug proneness or resolution time.
Contribution
It provides the first large-scale empirical analysis comparing JS and TS software quality across four facets, highlighting nuanced effects of type safety on bug metrics.
Findings
TypeScript apps have better code quality and understandability.
Bug proneness and fix time are not significantly lower in TypeScript.
Reduced use of `any` type correlates with improved quality metrics.
Abstract
JavaScript (JS) is one of the most popular programming languages, and widely used for web apps and even backend development. Due to its dynamic nature, however, JS applications often have a reputation for poor software quality. As a type-safe superset of JavaScript, TypeScript (TS) offers features to address this. However, there is currently insufficient empirical evidence to broadly support the claim that TS apps exhibit better software quality than JS apps. We therefore conducted a repository mining study based on 604 GitHub projects (299 for JS, 305 for TS) with over 16M LoC and collected four facets of software quality: a) code quality (# of code smells per LoC), b) code understandability (cognitive complexity per LoC), c) bug proneness (bug fix commit ratio), and d) bug resolution time (mean time a bug issue is open). For TS, we also collected how frequently the type-safety…
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.
Taxonomy
TopicsSoftware Engineering Research · Software Engineering Techniques and Practices · Software System Performance and Reliability
