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
来源
2017 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER) | 2017年
关键词
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
相关论文
共 55 条
[1]   An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, On Program Comprehension [J].
Abbes, Marwen ;
Khomh, Foutse ;
Gueheneuc, Yann-Gael ;
Antoniol, Giuliano .
2011 15TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR), 2011, :181-190
[2]  
[Anonymous], 2016, DEV SURVEY RESULTS 2
[3]  
[Anonymous], 2014, R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG R COMPANION APPL REG
[4]  
[Anonymous], 2016, ABOUT BOWER
[5]  
[Anonymous], 1995, DESIGN PATTERNS ELEM
[6]  
[Anonymous], 2016, NPM CODING STYLE
[7]  
[Anonymous], 2016, JQUERY JAVASCRIPT ST
[8]  
[Anonymous], 2016, Who uses grunt
[9]  
[Anonymous], 2016, Airbnb javascript style guide
[10]  
[Anonymous], 2016, Wordpress javascript coding standards