Open Access Open Access  Restricted Access Subscription Access

Identification and Refactoring of Exception Handling Code Smells in JavaScript

Chin-Yun Hsieh,
Canh Le My,
Kim Thoa Ho,
Yu Chin Cheng,

Abstract


Avoid making bad smells is very important in writing exception handling code for dealing with unexpected runtime errors. The task however is challenging and demands proficient programming skills and experience. This is particularly true in developing JavaScript applications because JavaScript is very rich in features as being dynamic, interpreted and object-oriented with first-class functions. What further complicates the situation is the use of event-driven and non-blocking I/O model in Node.js, which is a runtime environment written in server-side JavaScript. Extended from our previous work on exception handling code smells in Java, this study aims at identifying exception handling code smells that can occur in a JavaScript application at either the client side or the server side. The impact to software quality that each smell has is demonstrated with examples. Refactorings corresponding to the identified smells are proposed; their effects to the application, including the robustness level achieved and other benefits gained, are illustrated. The work is intended to serve as a guide in helping JavaScript developers avoid or discover exception handling code smells.

Keywords


Exception handling; Code smells; Refactoring; Node.js; JavaScript

Citation Format:
Chin-Yun Hsieh, Canh Le My, Kim Thoa Ho, Yu Chin Cheng, "Identification and Refactoring of Exception Handling Code Smells in JavaScript," Journal of Internet Technology, vol. 18, no. 6 , pp. 1461-1471, Nov. 2017.

Full Text:

PDF

Refbacks

  • There are currently no refbacks.





Published by Executive Committee, Taiwan Academic Network, Ministry of Education, Taipei, Taiwan, R.O.C
JIT Editorial Office, Library and Information Center, National Dong Hwa University
No. 1, Sec. 2, Da Hsueh Rd. Shoufeng, Hualien 97401, Taiwan, R.O.C.
Tel: +886-3-931-7017  E-mail: jit.editorial@gmail.com