An Anti-Pattern Detection Technique Using Machine Learning to Improve Code Quality

Nazneen Akhter, Shanto Rahman, K. A. Taher
{"title":"An Anti-Pattern Detection Technique Using Machine Learning to Improve Code Quality","authors":"Nazneen Akhter, Shanto Rahman, K. A. Taher","doi":"10.1109/ICICT4SD50815.2021.9396937","DOIUrl":null,"url":null,"abstract":"Poor software design and coding tend the software programs to be buggy at a massive rate. To enhance the code quality this paper proposes an automatic anti-pattern detection technique, which identifies anti-patterns from source code using Machine Learning (ML) classifiers. Here, four anti-patterns are considered such as Blob, Feature Decomposition (FD), Swiss Army Knife (SAK) and Spaghetti Code (SC) from three open-source Java projects namely ArgoUML, Azureus and Xerces. To improve the accuracy, a data pre-processing technique namely SMOTE is adopted. To locate these anti-patterns, four ML classifiers have been used which are Support Vector Machine (SVM), Naive Bayes (NB), Random Forest (RF) and Decision Tree (DT). The proposed technique shows a better performance in terms of three evaluation metrics such as precision, recall, f-measure. SVM with SMOTE performs better in terms of precision and recall that are respectively 96.42% and 96.18%.","PeriodicalId":239251,"journal":{"name":"2021 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD)","volume":"45 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-02-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 International Conference on Information and Communication Technology for Sustainable Development (ICICT4SD)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICICT4SD50815.2021.9396937","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

Poor software design and coding tend the software programs to be buggy at a massive rate. To enhance the code quality this paper proposes an automatic anti-pattern detection technique, which identifies anti-patterns from source code using Machine Learning (ML) classifiers. Here, four anti-patterns are considered such as Blob, Feature Decomposition (FD), Swiss Army Knife (SAK) and Spaghetti Code (SC) from three open-source Java projects namely ArgoUML, Azureus and Xerces. To improve the accuracy, a data pre-processing technique namely SMOTE is adopted. To locate these anti-patterns, four ML classifiers have been used which are Support Vector Machine (SVM), Naive Bayes (NB), Random Forest (RF) and Decision Tree (DT). The proposed technique shows a better performance in terms of three evaluation metrics such as precision, recall, f-measure. SVM with SMOTE performs better in terms of precision and recall that are respectively 96.42% and 96.18%.
利用机器学习提高代码质量的反模式检测技术
糟糕的软件设计和编码往往会导致软件程序大量出错。为了提高代码质量,本文提出了一种自动反模式检测技术,该技术使用机器学习(ML)分类器从源代码中识别反模式。这里考虑了四种反模式,如Blob、Feature Decomposition (FD)、Swiss Army Knife (SAK)和Spaghetti Code (SC),它们来自三个开源Java项目,即ArgoUML、Azureus和Xerces。为了提高精度,采用了SMOTE数据预处理技术。为了定位这些反模式,使用了四种ML分类器,即支持向量机(SVM),朴素贝叶斯(NB),随机森林(RF)和决策树(DT)。该方法在精度、召回率、f-measure三个评价指标上表现出较好的性能。SMOTE支持向量机的准确率和召回率分别为96.42%和96.18%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
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学术官方微信