JSNOSE: Detecting JavaScript Code Smells
- 1 September 2013
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 116-125
Abstract
JavaScript is a powerful and flexible prototype-based scripting language that is increasingly used by developers to create interactive web applications. The language is interpreted, dynamic, weakly-typed, and has first-class functions. In addition, it interacts with other web languages such as CSS and HTML at runtime. All these characteristics make JavaScript code particularly error-prone and challenging to write and maintain. Code smells are patterns in the source code that can adversely influence program comprehension and maintainability of the program in the long term. We propose a set of 13 JavaScript code smells, collected from various developer resources. We present a JavaScript code smell detection technique called JSNOSE. Our metric-based approach combines static and dynamic analysis to detect smells in client-side code. This automated technique can help developers to spot code that could benefit from refactoring. We evaluate the smell finding capabilities of our technique through an empirical study. By analyzing 11 web applications, we investigate which smells detected by JSNOSE are more prevalent.Keywords
This publication has 10 references indexed in Scilit:
- Detection of embedded code smells in dynamic web applications2012
- Automated analysis of CSS rules to support style maintenance2012
- Crawling Ajax-Based Web Applications through Dynamic Analysis of User Interface State ChangesACM Transactions on the Web, 2012
- An analysis of the dynamic behavior of JavaScript programs2010
- DECOR: A Method for the Specification and Detection of Code and Design SmellsIEEE Transactions on Software Engineering, 2009
- JDeodorant: Identification and Removal of Type-Checking Bad Smells2008
- Product Metrics for Automatic Identification of "Bad Smell" Design Problems in Java Source-Code2005
- A taxonomy and an initial empirical study of bad smells in code2004
- Metrics based refactoring2003
- Java quality assurance by detecting code smells2003