Automated Code Smell Detection for Software Quality Assurance Using a Web-Based Machine Learning Framework

preprint OA: closed
Full text JSON View at publisher
Full text 14,004 characters · extracted from preprint-html · click to expand
Automated Code Smell Detection for Software Quality Assurance Using a Web-Based Machine Learning Framework | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Automated Code Smell Detection for Software Quality Assurance Using a Web-Based Machine Learning Framework Saiful Islam Emon, Md Mahbubur Rahman, Amena Akter, Srikanto Rajbongshi, and 4 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-6474801/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Code Smells are indicators of structural weaknesses in software design and implementation that can negatively impact maintainability, scalability, and readability. To enhance software quality and support efficient maintenance, this study proposes a machine learning based approach for the automated detection of Critical Threshold Rule (CTR) violations, specifically targeting Long Method and Large Class Code Smell types. During the feature selection process, six machine learning models Decision Tree (DT), Random Forest (RF), Logistic Regression (LR), Support Vector Machine (SVM), Multi-layer Perceptron (MLP), and Stochastic Gradient Descent (SGD) were used alongside techniques such as GridSearchCV, RandomizedSearchCV, Out-of-Bag (OOB) validation, and SHAP values to improve both model performance and interpretability. After selecting the optimal features, thirteen machine learning classifiers were trained and evaluated: LR, DT, RF, SVM, Gaussian Naive Bayes (GNB), Multinomial Naive Bayes (MNB), MLP, Linear Support Vector (Linear SV), K-Nearest Neighbors (KNN), Gradient Boosting (GB), Extra Trees (ET), Bernoulli Naive Bayes (BNB), and AdaBoost (AB). These models were trained on datasets extracted from Software Development Versioning (SDV) repositories containing 1,000 log file entries. Evaluations across multiple metrics including accuracy, precision, recall, F1 score, and ROC AUC; showed that ensemble-based models, particularly RF, consistently delivered top performance, achieving the highest accuracy of 96.02% for Long method and 92.63% for Large Class dataset. The findings were further validated through statistical analysis using the Wilcoxon signed-rank test. To support practical use, the proposed method was implemented as a web application using the React Native framework. The system analyzes log data, identifies smelly code segments, and highlights their severity, offering actionable insights for developers. This approach provides a reliable and interpretable solution for Code Smell detection and shows strong potential for real-world integration into modern software development environments. Software Engineering Large Classes and Long Methods Feature Importance Statistical Tests Software Quality and Maintainability Web based Code Smell Detection Full Text Additional Declarations The authors declare no competing interests. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-6474801","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":444606336,"identity":"868d2ef5-2e67-4152-af02-8e4889455f64","order_by":0,"name":"Saiful Islam Emon","email":"","orcid":"","institution":"Bangladesh University of Business and Technology","correspondingAuthor":false,"prefix":"","firstName":"Saiful","middleName":"Islam","lastName":"Emon","suffix":""},{"id":444606337,"identity":"b5bcb784-e241-495b-973e-2bdcefacab86","order_by":1,"name":"Md Mahbubur Rahman","email":"","orcid":"","institution":"University of Wyoming","correspondingAuthor":false,"prefix":"","firstName":"Md","middleName":"Mahbubur","lastName":"Rahman","suffix":""},{"id":444606338,"identity":"2a8b261c-aec0-4e08-b7fe-9cf64893e4cf","order_by":2,"name":"Amena Akter","email":"","orcid":"","institution":"Bangladesh University of Business and Technology","correspondingAuthor":false,"prefix":"","firstName":"Amena","middleName":"","lastName":"Akter","suffix":""},{"id":444606339,"identity":"b9947118-e79e-4d31-945a-d75974bca62a","order_by":3,"name":"Srikanto Rajbongshi","email":"","orcid":"","institution":"University of Rajshahi","correspondingAuthor":false,"prefix":"","firstName":"Srikanto","middleName":"","lastName":"Rajbongshi","suffix":""},{"id":444606340,"identity":"87341073-7edb-4730-af2e-6dbea8630e28","order_by":4,"name":"Sumona Yeasmin","email":"","orcid":"","institution":"Bangladesh University of Business and Technology","correspondingAuthor":false,"prefix":"","firstName":"Sumona","middleName":"","lastName":"Yeasmin","suffix":""},{"id":444606341,"identity":"c6f33b0b-7a74-4e5a-a17c-739ef93a3e35","order_by":5,"name":"M.A. Nur Quraishi","email":"","orcid":"","institution":"Bangladesh University of Business and Technology","correspondingAuthor":false,"prefix":"","firstName":"M.A.","middleName":"Nur","lastName":"Quraishi","suffix":""},{"id":444606342,"identity":"26434655-eb7e-4c91-9876-96bb80dab204","order_by":6,"name":"Ahmad Shafkat","email":"","orcid":"","institution":"Bangladesh University of Business and Technology","correspondingAuthor":false,"prefix":"","firstName":"Ahmad","middleName":"","lastName":"Shafkat","suffix":""},{"id":444606343,"identity":"756d1c96-6816-4ddc-a41d-5c8eecb33e17","order_by":7,"name":"Yaqoob Majeed","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAxElEQVRIiWNgGAWjYJACAwYGZjkom5l4LcakaQGpTGwgWovBtcMPCj5UWKdvuJFj+IChwhqmF4+W22kGhjPOpOcCtRgbMJxJJ0ZLgoExb9vh3A23c8wkGNsOE6Ml/YPx33+H0w3AWv4RpSXHwJix4XACREsDEVokb+cUGPYcSzecef9ZsUHCsXRjglr4bqdvM/hRYy3Pd+bwxgcfaqxlCWpROMDAZgBhchgwJBBSDgLyDQzMDyBM9gfEaBgFo2AUjIIRCACkxUQaVwFSZQAAAABJRU5ErkJggg==","orcid":"","institution":"University of Wyoming","correspondingAuthor":true,"prefix":"","firstName":"Yaqoob","middleName":"","lastName":"Majeed","suffix":""}],"badges":[],"createdAt":"2025-04-17 23:21:54","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-6474801/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-6474801/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":80993285,"identity":"745608db-67f7-4709-9f72-56d6d0bbce17","added_by":"auto","created_at":"2025-04-21 03:58:58","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":2175810,"visible":true,"origin":"","legend":"","description":"","filename":"CodeSmellinglManuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-6474801/v1_covered_d559b6a3-b38b-4d8b-8067-31b5b88da9c3.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003e\u003cstrong\u003eAutomated Code Smell Detection for Software Quality Assurance Using a Web-Based Machine Learning Framework\u003c/strong\u003e\u003c/p\u003e","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"University of Wyoming","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Large Classes and Long Methods, Feature Importance Statistical Tests, Software Quality and Maintainability, Web based Code Smell Detection","lastPublishedDoi":"10.21203/rs.3.rs-6474801/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-6474801/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eCode Smells are indicators of structural weaknesses in software design and implementation that can negatively impact maintainability, scalability, and readability. To enhance software quality and support efficient maintenance, this study proposes a machine learning based approach for the automated detection of Critical Threshold Rule (CTR) violations, specifically targeting Long Method and Large Class Code Smell types. During the feature selection process, six machine learning models Decision Tree (DT), Random Forest (RF), Logistic Regression (LR), Support Vector Machine (SVM), Multi-layer Perceptron (MLP), and Stochastic Gradient Descent (SGD) were used alongside techniques such as GridSearchCV, RandomizedSearchCV, Out-of-Bag (OOB) validation, and SHAP values to improve both model performance and interpretability. After selecting the optimal features, thirteen machine learning classifiers were trained and evaluated: LR, DT, RF, SVM, Gaussian Naive Bayes (GNB), Multinomial Naive Bayes (MNB), MLP, Linear Support Vector (Linear SV), K-Nearest Neighbors (KNN), Gradient Boosting (GB), Extra Trees (ET), Bernoulli Naive Bayes (BNB), and AdaBoost (AB). These models were trained on datasets extracted from Software Development Versioning (SDV) repositories containing 1,000 log file entries. Evaluations across multiple metrics including accuracy, precision, recall, F1 score, and ROC AUC; showed that ensemble-based models, particularly RF, consistently delivered top performance, achieving the highest accuracy of 96.02% for Long method and 92.63% for Large Class dataset. The findings were further validated through statistical analysis using the Wilcoxon signed-rank test. To support practical use, the proposed method was implemented as a web application using the React Native framework. The system analyzes log data, identifies smelly code segments, and highlights their severity, offering actionable insights for developers. This approach provides a reliable and interpretable solution for Code Smell detection and shows strong potential for real-world integration into modern software development environments.\u003c/p\u003e","manuscriptTitle":"Automated Code Smell Detection for Software Quality Assurance Using a Web-Based Machine Learning Framework","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-04-21 03:50:49","doi":"10.21203/rs.3.rs-6474801/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"e84c4f42-9126-4310-9c67-13c56db45751","owner":[],"postedDate":"April 21st, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[{"id":47337211,"name":"Software Engineering"}],"tags":[],"updatedAt":"2025-04-21T03:50:49+00:00","versionOfRecord":[],"versionCreatedAt":"2025-04-21 03:50:49","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-6474801","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-6474801","identity":"rs-6474801","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-19T01:45:01.086888+00:00