[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-120123-en":3,"doc-seo-120123-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},120123,8796095461564,"Liam","https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d",8,"Research & Report","Unsupervised Machine Learning for Effective Code Smell Detection: A Novel Method","Code smells degrade source-code quality by signaling underlying design issues that reduce maintainability, readability, and performance. Prior detection strategies include metric- and heuristic-based approaches, but supervised machine learning has been most effective while relying on expensive, high-quality labeled data, representative training sets, and risking bias from labeled examples. This study proposes an unsupervised machine learning method with feature engineering to avoid labeled-data dependence and reduce bias. Evaluations on four datasets across multiple smell types show performance comparable to supervised baselines and support detection of new smells and multi-smell identification in real codebases.","Unsupervised Machine Learning for Effective Code Smell Detection: A Novel Method  \nRuchin Gupta, Narendra Kumar, Sunil Kumar, and Jitendra Kumar Seth  \nOriginal scientific article  \nAbstract—The quality of source code is negatively impacted by code smells. Since the term \"code smell\" originated, numerous attempts have been made to comprehend it by identifying it using various techniques, such as metric-based, heuristic-based, optimization-based, machine learning (ML)-based, etc. Among these, supervised machine learning (SML) has shown effectiveness in detecting code smells. However, SML techniques have significant limitations, including the dependency on expensive and high-quality labeled data, the need for representative training datasets, and the risk of introducing biases in labeled examples that lead to skewed predictions. To overcome these challenges, this study introduces a method that leverages unsupervised machine learning (UnML) along with feature engineering. Unlike SML, UnML does not require labeled data and minimizes potential biases. The proposed method was evaluated using four datasets containing different types of code smells and was compared with a previous study that used SML techniques. The results indicate that the UnML-based method is effective, achieving outcomes closely aligned with those from the SML approach. This method is especially beneficial in situations where labeled data is scarce or unavailable and can be used to identify new code smells, generate labeled data for SML and detect multiple code smells simultaneously within a codebase.  \nIndex terms—code smell, unsupervised machine learning, open-source Java projects.  \nI. INTRODUCTION  \nKent Beck was the first person who invented the phrase“code smell” in 1999 [1] . Code smell was defined as “certain structures in the code that suggest (or sometimes scream) for refactoring.” Code smell refers to any characteristic of a source code that could indicate a significant underlying issue. The term \"smell\" is used metaphorically to indicate that there might be something wrong with the code, even though it may still function correctly. Code smells are not bugs themselves, but they often indicate areas of the code that could benefit from refactoring or further investigation to improve maintainability, readability, or performance.  \nManuscript received October 18, 2024; revised November 6, 2024. Date of publication December 9, 2024. Date of current version December 9, 2024. The associate editor prof. Renata Lopes Rosa has been coordinating the review of this manuscript and approved it for publication.  \nR. Gupta and J. K. Seth are with the Department of Information Technology, KIET Group of Institutions, Delhi-NCR, Ghaziabad, India.(emails: [skg11in@yahoo.co.in](skg11in@yahoo.co.in), [drjkseth@gmail.com](drjkseth@gmail.com)).  \nN. Kumar and S. Kumar are with the Galgotias College of Engineering and Technology (e-mails: [nkteotia2004@gmail.com](nkteotia2004@gmail.com), [skkiet@gmail.com](skkiet@gmail.com)).  \nDigital Object Identifier (DOI): 10.24138/jcomss-2024-0083  \nCode smells indicate symptoms present in the source code that have an impact on the quality characteristics of the software [1], [2] . Code smells are apparent characteristics that suggest the existence of design problems or deficiencies in the code. These problems or deficiencies have a significant impact on crucial aspects of code quality, like maintainability, reusability, and understandability [1] . Code smell typically refers to underlying problems in a code that degrade its quality and can lead to significant issues [3]–[5] . Code smells when present in large numbers in software makes it difficult to maintain. First, Martin Fowler defined a catalogue of 22 code smells [1] .  \nThe first step in dealing with code smell is its detection which is followed by refactoring. The process of refactoring modifies the internal structure of code without altering its external functionality. The main ob","cbCaidecSVvuc1QG","https://ap.wps.com/l/cbCaidecSVvuc1QG","pdf",1329066,1,10,"English","en",105,"# Abstract\n# Introduction\n## Code smells and refactoring\n## Importance of code smell detection\n## Existing approaches and motivation\n## Paper overview","[{\"question\":\"Why is code smell detection important for software quality?\",\"answer\":\"Code smells are symptoms that negatively affect maintainability, reusability, and understandability. Detecting and addressing them early reduces technical debt and lowers the chance of introducing defects while improving scalability and developer productivity.\"},{\"question\":\"What limitations of supervised machine learning motivate the proposed method?\",\"answer\":\"Supervised ML depends on expensive, high-quality labeled data, requires representative training datasets, and can introduce biases in labeled examples that skew predictions.\"},{\"question\":\"How does the proposed approach differ from supervised methods?\",\"answer\":\"The method uses unsupervised machine learning with feature engineering, avoiding the need for labeled data and minimizing potential bias. It can also identify new code smells, generate labeled data for supervised learning, and detect multiple code smells simultaneously.\"}]","Unsupervised Machine Learning for Effective Code Smell Detection: A Novel Method | PDF",1785728319,25,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"unsupervised-machine-learning-for-effective-code-smell-detection-a-novel-method","",{"@graph":36,"@context":85},[37,54,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/unsupervised-machine-learning-for-effective-code-smell-detection-a-novel-method/120123/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":62,"encodingFormat":61,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-03",true,{"@type":65,"interactionType":66,"userInteractionCount":4},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"Why is code smell detection important for software quality?","Question",{"text":75,"@type":76},"Code smells are symptoms that negatively affect maintainability, reusability, and understandability. Detecting and addressing them early reduces technical debt and lowers the chance of introducing defects while improving scalability and developer productivity.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What limitations of supervised machine learning motivate the proposed method?",{"text":80,"@type":76},"Supervised ML depends on expensive, high-quality labeled data, requires representative training datasets, and can introduce biases in labeled examples that skew predictions.",{"name":82,"@type":73,"acceptedAnswer":83},"How does the proposed approach differ from supervised methods?",{"text":84,"@type":76},"The method uses unsupervised machine learning with feature engineering, avoiding the need for labeled data and minimizing potential bias. It can also identify new code smells, generate labeled data for supervised learning, and detect multiple code smells simultaneously.","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,134],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":21,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":21,"slug":133},"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]