JavaScript代码气味检测的随机森林

Diego S. Sarafim, K. V. Delgado, D. Cordeiro
{"title":"JavaScript代码气味检测的随机森林","authors":"Diego S. Sarafim, K. V. Delgado, D. Cordeiro","doi":"10.5753/eniac.2022.227328","DOIUrl":null,"url":null,"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.","PeriodicalId":165095,"journal":{"name":"Anais do XIX Encontro Nacional de Inteligência Artificial e Computacional (ENIAC 2022)","volume":"64 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-11-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Random Forest for Code Smell Detection in JavaScript\",\"authors\":\"Diego S. Sarafim, K. V. Delgado, D. Cordeiro\",\"doi\":\"10.5753/eniac.2022.227328\",\"DOIUrl\":null,\"url\":null,\"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.\",\"PeriodicalId\":165095,\"journal\":{\"name\":\"Anais do XIX Encontro Nacional de Inteligência Artificial e Computacional (ENIAC 2022)\",\"volume\":\"64 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2022-11-28\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Anais do XIX Encontro Nacional de Inteligência Artificial e Computacional (ENIAC 2022)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.5753/eniac.2022.227328\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Anais do XIX Encontro Nacional de Inteligência Artificial e Computacional (ENIAC 2022)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.5753/eniac.2022.227328","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

JavaScript已经成为使用最广泛的编程语言之一。JavaScript是一种动态的、解释的、弱类型的脚本语言,特别适合于web应用程序的开发。虽然这些特征使该语言提供了高度的灵活性,但它们也会使JavaScript代码的编写、维护和发展更具挑战性。JavaScript和其他编程语言容易出现的风险之一是存在代码异味。代码异味来自于源代码开发过程中糟糕的编程选择,从长远来看会对源代码的可理解性和可维护性产生负面影响。这项工作报告了一种方法的结果,该方法使用随机森林算法根据从JavaScript源代码中提取的软件度量来检测一组11种代码气味。它还报告了两个数据集的构建,一个用于影响函数/方法的代码气味,另一个用于与类相关的代码气味,两者都包含至少200个标记的每种代码气味的积极实例,并且都是从25个开源JavaScript项目中提取的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Random Forest for Code Smell Detection in JavaScript
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.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信