An Empirical Study of Code Smells in Java']JavaScript Projects

被引:0
|
作者
Saboury, Amir [1 ]
Musavi, Pooya [1 ]
Khomh, Foutse [1 ]
Antoniol, Giulio [1 ]
机构
[1] Polytech Montreal, Quebec City, PQ, Canada
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
JavaScript is a powerful scripting programming language that has gained a lot of attention this past decade. Initially used exclusively for client-side web development, it has evolved to become one of the most popular programming languages, with developers now using it for both client-side and server-side application development. Similar to applications written in other programming languages, JavaScript applications contain code smells, which are poor design choices that can negatively impact the quality of an application. In this paper, we investigate code smells in JavaScript server-side applications with the aim to understand how they impact the fault-proneness of applications. We detect 12 types of code smells in 537 releases of five popular JavaScript applications (i.e., express, grunt, bower, less. js, and request) and perform survival analysis, comparing the time until a fault occurrence, in files containing code smells and files without code smells. Results show that (1) on average, files without code smells have hazard rates 65% lower than files with code smells. (2) Among the studied smells, "Variable Re-assign" and "Assignment In Conditional statements" code smells have the highest hazard rates. Additionally, we conduct a survey with 1,484 JavaScript developers, to understand the perception of developers towards our studied code smells. We found that developers consider "Nested Callbacks", "Variable Re-assign" and "Long Parameter List" code smells to be serious design problems that hinder the maintainability and reliability of applications. This assessment is in line with the findings of our quantitative analysis. Overall, code smells affect negatively the quality of JavaScript applications and developers should consider tracking and removing them early on before the release of applications to the public.
引用
收藏
页码:294 / 305
页数:12
相关论文
共 50 条
  • [1] A large-scale empirical study of code smells in Java']JavaScript projects
    Johannes, David
    Khomh, Foutse
    Antoniol, Giuliano
    [J]. SOFTWARE QUALITY JOURNAL, 2019, 27 (03) : 1271 - 1314
  • [2] A large-scale empirical study of code smells in JavaScript projects
    David Johannes
    Foutse Khomh
    Giuliano Antoniol
    [J]. Software Quality Journal, 2019, 27 : 1271 - 1314
  • [3] Dependency Smells in Java']JavaScript Projects
    Jafari, Abbas Javan
    Costa, Diego Elias
    Abdalkareem, Rabe
    Shihab, Emad
    Tsantalis, Nikolaos
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (10) : 3790 - 3807
  • [4] JS']JSNOSE: Detecting Java']JavaScript Code Smells
    Fard, Amin Milani
    Mesbah, Ali
    [J]. 2013 IEEE 13TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2013, : 116 - 125
  • [5] Identification and Refactoring of Exception Handling Code Smells in Java']JavaScript
    Hsieh, Chin-Yun
    Canh Le My
    Kim Thoa Ho
    Cheng, Yu Chin
    [J]. JOURNAL OF INTERNET TECHNOLOGY, 2017, 18 (06): : 1461 - 1471
  • [6] On the Use of Smelly Examples to Detect Code Smells in Java']JavaScript
    Shoenberger, Ian
    Mkaouer, Mohamed Wiem
    Kessentini, Marouane
    [J]. APPLICATIONS OF EVOLUTIONARY COMPUTATION (EVOAPPLICATIONS 2017), PT II, 2017, 10200 : 20 - 34
  • [7] Uncovering Java']JavaScript Performance Code Smells Relevant to Type Mutations
    Xiao, Xiao
    Han, Shi
    Zhang, Charles
    Zhang, Dongmei
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2015, 2015, 9458 : 335 - 355
  • [8] An Empirical Study on the Occurrences of Code Smells in Open Source and Industrial Projects
    Rahman, Md. Masudur
    Satter, Abdus
    Joarder, Md. Mahbubul Alam
    Sakib, Kazi
    [J]. PROCEEDINGS OF THE16TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT, ESEM 2022, 2022, : 289 - 294
  • [9] On the diffusion of test smells and their relationship with test code quality of Java']Java projects
    Martins, Luana
    Costa, Heitor
    Machado, Ivan
    [J]. JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2024, 36 (04)
  • [10] Development nature matters: An empirical study of code clones in Java']JavaScript applications
    Cheung, Wai Ting
    Ryu, Sukyoung
    Kim, Sunghun
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2016, 21 (02) : 517 - 564