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 条
  • [31] Static code analysis for reducing energy code smells in different loop types: a case study in Java']Java
    Gurung, Ram Prasad
    Porras, Jari
    Koistinaho, Jarrkko
    2024 10TH INTERNATIONAL CONFERENCE ON ICT FOR SUSTAINABILITY, ICT4S 2024, 2024, : 292 - 302
  • [32] An Empirical Study of Code Smells in Transformer-based Code Generation Techniques
    Siddiq, Mohammed Latif
    Majumder, Shafayat H.
    Mim, Maisha R.
    Jajodia, Sourov
    Santos, Joanna C. S.
    2022 IEEE 22ND INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2022), 2022, : 71 - 82
  • [33] Characterizing refactoring graphs in Java and JavaScript projects
    Aline Brito
    Andre Hora
    Marco Tulio Valente
    Empirical Software Engineering, 2021, 26
  • [34] A detection tool for code bad smells in java source code
    Gupta, Aakanshi
    Suri, Bharti
    Wadhwa, Bimlesh
    Advances in Intelligent Systems and Computing, 2021, 1086 : 479 - 488
  • [35] Empirical study of the relationship between design patterns and code smells
    Alfadel, Mahmoud
    Aljasser, Khalid
    Alshayeb, Mohammad
    PLOS ONE, 2020, 15 (04):
  • [36] On the Effectiveness of Concern Metrics to Detect Code Smells: An Empirical Study
    Padilha, Juliana
    Pereira, Juliana
    Figueiredo, Eduardo
    Almeida, Jussara
    Garcia, Alessandro
    Sant'Anna, Claudio
    ADVANCED INFORMATION SYSTEMS ENGINEERING (CAISE 2014), 2014, 8484 : 656 - 671
  • [37] Are Existing Code Smells Relevant in Web Games? An Empirical Study
    Khanve, Vaishali
    ESEC/FSE'2019: PROCEEDINGS OF THE 2019 27TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2019, : 1241 - 1243
  • [38] Polymorphic Algorithm of Java']JavaScript Code Protection
    Qin, Jiancheng
    Bai, Zhongying
    Bai, Yuan
    ISCSCT 2008: INTERNATIONAL SYMPOSIUM ON COMPUTER SCIENCE AND COMPUTATIONAL TECHNOLOGY, VOL 1, PROCEEDINGS, 2008, : 451 - 454
  • [39] Are existing code smells relevant in web games? An empirical study
    Khanve, Vaishali
    ESEC/FSE 2019 - Proceedings of the 2019 27th ACM Joint Meeting European Software Engineering Conference and Symposium on the Foundations of Software Engineering, 2019, : 1241 - 1243
  • [40] An Investigation of confusing code patterns in Java']JavaScript
    Torres, Adriano
    Oliveira, Caio
    Okimoto, Marcio
    Marcilio, Diego
    Queiroga, Pedro
    Castor, Fernando
    Bonifacio, Rodrigo
    Canedo, Edna Dias
    Ribeiro, Marcio
    Monteiro, Eduardo
    JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 203