Random Forest for Code Smell Detection in JavaScript

Saved in:
Bibliographic Details
Title: Random Forest for Code Smell Detection in JavaScript
Authors: Diego S. Sarafim, Karina V. Delgado, Daniel Cordeiro
Source: Anais do XIX Encontro Nacional de Inteligência Artificial e Computacional (ENIAC 2022). :13-24
Publisher Information: Sociedade Brasileira de Computação - SBC, 2022.
Publication Year: 2022
Subject Terms: 0202 electrical engineering, electronic engineering, information engineering, 02 engineering and technology
Description: JavaScript has become one of the most widely used programming languages. JavaScript is a dynamic, interpreted, and weakly-typed scripting language especially suited for the development of web applications. While these characteristics allow the language to offer high levels of flexibility, they also can make JavaScript code more challenging to write, maintain and evolve. One of the risks that JavaScript and other programming languages are prone to is the presence of code smells. Code smells result from poor programming choices during source code development that negatively influence source code comprehension and maintainability in the long term. This work reports the result of an approach that uses the Random Forest algorithm to detect a set of 11 code smells based on software metrics extracted from JavaScript source code. It also reports the construction of two datasets, one for code smells that affect functions/methods, and another for code smells related to classes, both containing at least 200 labeled positive instances of each code smell and both extracted from a set of 25 open-source JavaScript projects.
Document Type: Article
DOI: 10.5753/eniac.2022.227328
Accession Number: edsair.doi...........2cc04ac8df65d30deb3eeee84648e7fb
Database: OpenAIRE
Description
Abstract:JavaScript has become one of the most widely used programming languages. JavaScript is a dynamic, interpreted, and weakly-typed scripting language especially suited for the development of web applications. While these characteristics allow the language to offer high levels of flexibility, they also can make JavaScript code more challenging to write, maintain and evolve. One of the risks that JavaScript and other programming languages are prone to is the presence of code smells. Code smells result from poor programming choices during source code development that negatively influence source code comprehension and maintainability in the long term. This work reports the result of an approach that uses the Random Forest algorithm to detect a set of 11 code smells based on software metrics extracted from JavaScript source code. It also reports the construction of two datasets, one for code smells that affect functions/methods, and another for code smells related to classes, both containing at least 200 labeled positive instances of each code smell and both extracted from a set of 25 open-source JavaScript projects.
DOI:10.5753/eniac.2022.227328