To Type or Not to Type? A Systematic Comparison of the Software Quality of JavaScript and TypeScript Applications on GitHub
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 t...
Gespeichert in:
| Veröffentlicht in: | arXiv.org |
|---|---|
| Hauptverfasser: | , |
| Format: | Paper |
| Sprache: | Englisch |
| Veröffentlicht: |
Ithaca
Cornell University Library, arXiv.org
21.03.2022
|
| Schlagworte: | |
| ISSN: | 2331-8422 |
| Online-Zugang: | Volltext |
| Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
| 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 ignoring `any` type was used. The analysis indicates that TS apps exhibit significantly better code quality and understandability than JS apps. Contrary to expectations, however, bug proneness and bug resolution time of our TS sample were not significantly lower than for JS: mean bug fix commit ratio was more than 60% larger (0.126 vs. 0.206), and TS projects needed on average more than an additional day to fix bugs (31.86 vs. 33.04 days). Furthermore, reducing the usage of the `any` type in TS apps was significantly correlated with all metrics except bug proneness (Spearman's rho between 0.17 and 0.26). Our results indicate that the perceived positive influence of TypeScript for avoiding bugs in comparison to JavaScript may be more complicated than assumed. While using TS seems to have benefits, it does not automatically lead to less and easier to fix bugs. However, more research is needed in this area, especially concerning the potential influence of project complexity and developer experience. |
|---|---|
| AbstractList | 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 ignoring `any` type was used. The analysis indicates that TS apps exhibit significantly better code quality and understandability than JS apps. Contrary to expectations, however, bug proneness and bug resolution time of our TS sample were not significantly lower than for JS: mean bug fix commit ratio was more than 60% larger (0.126 vs. 0.206), and TS projects needed on average more than an additional day to fix bugs (31.86 vs. 33.04 days). Furthermore, reducing the usage of the `any` type in TS apps was significantly correlated with all metrics except bug proneness (Spearman's rho between 0.17 and 0.26). Our results indicate that the perceived positive influence of TypeScript for avoiding bugs in comparison to JavaScript may be more complicated than assumed. While using TS seems to have benefits, it does not automatically lead to less and easier to fix bugs. However, more research is needed in this area, especially concerning the potential influence of project complexity and developer experience. |
| Author | Bogner, Justus Merkel, Manuel |
| Author_xml | – sequence: 1 givenname: Justus surname: Bogner fullname: Bogner, Justus – sequence: 2 givenname: Manuel surname: Merkel fullname: Merkel, Manuel |
| BookMark | eNotjcFPwjAchRujiYj8Ad6aeB7-2q5ddzKEKGiIxrA7aUcbS2CdbYcQ_3mn8C4v3zt87wZdNr4xCN0RGOeSc3hQ4eD2Y0qBjUkffoEGlDGSyZzSazSKcQMAVBSUczZAP5XH1bE12Af85hNOJ3zEE7w8xmR2KrkaT_2uVcFF32Bvcfo0eOlt-lbB4I9ObV06_u2vaq-WdXBtwqpZ_3vOOGnbrat7lW8i7iUzl-advkVXVm2jGZ17iKrnp2o6zxbvs5fpZJEpTkWmi1zzstAETFkWhmluJADXkJNaALHClkoTAUxKw4zVoi40ExpKVaxrVVo2RPcnbRv8V2diWm18F5r-cUVFToSkQgr2C01UYUQ |
| ContentType | Paper |
| Copyright | 2022. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. |
| Copyright_xml | – notice: 2022. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License. |
| DBID | 8FE 8FG ABJCF ABUWG AFKRA AZQEC BENPR BGLVJ CCPQU DWQXO HCIFZ L6V M7S PHGZM PHGZT PIMPY PKEHL PQEST PQGLB PQQKQ PQUKI PRINS PTHSS |
| DOI | 10.48550/arxiv.2203.11115 |
| DatabaseName | ProQuest SciTech Collection ProQuest Technology Collection Materials Science & Engineering Collection ProQuest Central (Alumni) ProQuest Central UK/Ireland ProQuest Central Essentials ProQuest Central Technology Collection ProQuest One Community College ProQuest Central SciTech Premium Collection ProQuest Engineering Collection Engineering Database ProQuest Central Premium ProQuest One Academic (New) Publicly Available Content Database ProQuest One Academic Middle East (New) ProQuest One Academic Eastern Edition (DO NOT USE) ProQuest One Applied & Life Sciences ProQuest One Academic (retired) ProQuest One Academic UKI Edition ProQuest Central China Engineering Collection |
| DatabaseTitle | Publicly Available Content Database Engineering Database Technology Collection ProQuest One Academic Middle East (New) ProQuest Central Essentials ProQuest One Academic Eastern Edition ProQuest Central (Alumni Edition) SciTech Premium Collection ProQuest One Community College ProQuest Technology Collection ProQuest SciTech Collection ProQuest Central China ProQuest Central ProQuest One Applied & Life Sciences ProQuest Engineering Collection ProQuest One Academic UKI Edition ProQuest Central Korea Materials Science & Engineering Collection ProQuest Central (New) ProQuest One Academic ProQuest One Academic (New) Engineering Collection |
| DatabaseTitleList | Publicly Available Content Database |
| Database_xml | – sequence: 1 dbid: PIMPY name: Publicly Available Content Database url: http://search.proquest.com/publiccontent sourceTypes: Aggregation Database |
| DeliveryMethod | fulltext_linktorsrc |
| Discipline | Physics |
| EISSN | 2331-8422 |
| Genre | Working Paper/Pre-Print |
| GroupedDBID | 8FE 8FG ABJCF ABUWG AFKRA ALMA_UNASSIGNED_HOLDINGS AZQEC BENPR BGLVJ CCPQU DWQXO FRJ HCIFZ L6V M7S M~E PHGZM PHGZT PIMPY PKEHL PQEST PQGLB PQQKQ PQUKI PRINS PTHSS |
| ID | FETCH-LOGICAL-a526-b74b597b10e997e3b5e8005b041c601f6f9ab160388e3efb6c7b36b09a7dca9f3 |
| IEDL.DBID | M7S |
| IngestDate | Mon Jun 30 09:08:13 EDT 2025 |
| IsDoiOpenAccess | true |
| IsOpenAccess | true |
| IsPeerReviewed | false |
| IsScholarly | false |
| Language | English |
| LinkModel | DirectLink |
| MergedId | FETCHMERGED-LOGICAL-a526-b74b597b10e997e3b5e8005b041c601f6f9ab160388e3efb6c7b36b09a7dca9f3 |
| Notes | SourceType-Working Papers-1 ObjectType-Working Paper/Pre-Print-1 content type line 50 |
| OpenAccessLink | https://www.proquest.com/docview/2641682686?pq-origsite=%requestingapplication% |
| PQID | 2641682686 |
| PQPubID | 2050157 |
| ParticipantIDs | proquest_journals_2641682686 |
| PublicationCentury | 2000 |
| PublicationDate | 20220321 |
| PublicationDateYYYYMMDD | 2022-03-21 |
| PublicationDate_xml | – month: 03 year: 2022 text: 20220321 day: 21 |
| PublicationDecade | 2020 |
| PublicationPlace | Ithaca |
| PublicationPlace_xml | – name: Ithaca |
| PublicationTitle | arXiv.org |
| PublicationYear | 2022 |
| Publisher | Cornell University Library, arXiv.org |
| Publisher_xml | – name: Cornell University Library, arXiv.org |
| SSID | ssj0002672553 |
| Score | 1.7887009 |
| SecondaryResourceType | preprint |
| Snippet | 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,... |
| SourceID | proquest |
| SourceType | Aggregation Database |
| SubjectTerms | Applications programs Complexity Empirical analysis Java JavaScript Software Software quality Source code |
| Title | To Type or Not to Type? A Systematic Comparison of the Software Quality of JavaScript and TypeScript Applications on GitHub |
| URI | https://www.proquest.com/docview/2641682686 |
| hasFullText | 1 |
| inHoldings | 1 |
| isFullTextHit | |
| isPrint | |
| link | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwpV1NT4MwGG5008ST3_Fjmh681kELBU7LXDanUUJkMfO0tKUku8AENjX-eduOTRMTLx5fCA0p5en71ecB4CrxLIe5mCPHSShyCHMR04QAavUIVxLGEnPK9fnBC0N_PA6iOuFW1m2VK0w0QJ3kQufI22rjtqnyhX3amb0irRqlq6u1hMYmaGqWBNu07sXrHAumnvKYybKYaai72qx4ny6uMbaIAQv3FwSbfWWw-9832gPNiM1ksQ82ZHYAtk0_pygPwecohzrEhHkBw7yC1dLswC6M19zNsLcWIYR5CpUrCGOFym-skHDJrfGhr9-zBYsNuECWJWac2uz-qH5DNcjttBrO-REYDfqj3hDVOgtIfSWKuOdwFVZw25JB4EnCXam8SJdbji1UuJbSNGBcq1H7viQy5VR4nFBuBcxLBAtScgwaWZ7JEwAtImwpGPZ1mMVdnyt3UVqSqgdxIoh7ClqrqZzU_0o5-Z7Hs79vn4MdrA8fWARhuwUaVTGXF2BLLKppWVyC5k0_jJ4uzRJQVnT3GL18ATYQvMU |
| linkProvider | ProQuest |
| linkToHtml | http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMw1V3JTsMwEB1BAcGJXSwFfIBjILETJzkghMpSoFRIrRC3ynYcqZempGlLxTfxj4zdBSQkbhw4OlFGSWb05o09C8BxErq-CKh0fD_hjs9E4AjTEACtRwWaCZHYKtfnWlivRy8v8dMcfExrYUxa5RQTLVAnmTJ75GfouD2OXDjiF91Xx0yNMqer0xEaY7N40KMhhmy987sr1O8JpTfXzUrVmUwVcPCduCNDXyKJlp6r4zjUTAYaOVMgXd9TGJykPI2FNLOXo0gznUquQsm4dGMRJkrEKUOx87CALILGNlOwMdvSoTxEgs7GZ6e2U9iZyN_ag1NKXWaxKfiB-NaN3az-sx-wBgtPoqvzdZjTnQ1YstmqqrcJ782MmACaZDmpZwUpxssLckkas87UpDIbsUiylCDRJQ30OUORazLuHDIy1-_FQDQsdBLRSaycyfLy29k-QSG37aLal1vQ_IvP3YZSJ-voHSAuU55WgkYmiJRBJJEMa1dzfJAmigW7UJ5qrjVBgl7rS217v98-guVq87HWqt3VH_ZhhZoyC5c51CtDqcj7-gAW1aBo9_JDa3UEWn-s5E-5cRVl |
| openUrl | ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=To+Type+or+Not+to+Type%3F+A+Systematic+Comparison+of+the+Software+Quality+of+JavaScript+and+TypeScript+Applications+on+GitHub&rft.jtitle=arXiv.org&rft.au=Bogner%2C+Justus&rft.au=Merkel%2C+Manuel&rft.date=2022-03-21&rft.pub=Cornell+University+Library%2C+arXiv.org&rft.eissn=2331-8422&rft_id=info:doi/10.48550%2Farxiv.2203.11115 |