[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-118315-en":3,"doc-seo-118315-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},118315,7971461740909,"Levi","https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d",8,"Research & Report","Investigating the Accuracy of Metric-Based versus Machine Learning Approaches in Detecting Design Patterns - Bachelor of Science Thesis","Design pattern detection approaches have evolved, with machine-learning methods gaining prominence, yet requiring extensive training and large labeled datasets. This thesis evaluates a simpler metric-based alternative and compares detection accuracy against machine learning. The study tests both approaches across Java and C++ using eighteen open-source projects. Results show the metric approach can achieve comparable or better F-score by extracting program metrics via scripts, offering a practical way to simplify pattern analysis. Future work should examine metric-based usage in industry settings.","Investigating the Accuracy of  \nMetric-Based versus Machine Learning Approaches  \nin Detecting Design Patterns  \nBachelor of Science Thesis in Software Engineering and Management  \nNils Dunlop  \nThe Author grants to University of Gothenburg and Chalmers University of Technology thenon-exclusive right to publish the Work electronically and in a non-commercial purpose make it accessible on the Internet.  \nThe Author warrants that he/she is the author to the Work, and warrants that the Work does not contain text, pictures or other material that violates copyright law.  \nThe Author shall, when transferring the rights of the Work to a third party (for example a publisher or a company), acknowledge the third party about this agreement. If the Author has signed a copyright agreement with a third party regarding the Work, the Author warrants hereby that he/she has obtained any necessary permission from this third party to let University of Gothenburg and Chalmers University of Technology store the Work electronically and make it accessible on the Internet.  \nA comparative analysis of metric and machine learning approaches for design pattern detection using eighteen open-source projects in C++ and Java.  \nExploring the potential of design pattern detection methods with and without machine learning.  \n© Nils Dunlop, June 2023.  \nSupervisor: Jennifer Horkoff  \nExaminer: Daniel Strüber  \nUniversity of Gothenburg  \nChalmers University of Technology  \nDepartment of Computer Science and Engineering SE-412 96 Göteborg  \nSweden  \nTelephone + 46 (0)31-772 1000  \nInvestigating the Accuracy of Metric-Based and Machine Learning Approaches in Detecting Design Patterns  \nAuthor: Nils Dunlop  \nAcademic supervisor: Jennifer Horkoff  \nAbstract— Design pattern detection approaches have evolved, with machine-learning methods gaining prominence. However, implementing machine-learning models can be challenging due to extensive training requirements and the need for large labeled design pattern datasets. This study tests a simpler alternative that overcomes these specific machine learning limitations, and compares design pattern detection accuracy of machine-learning approaches and a metric approach, using both Java and C++. Without relying on AI, the metric approach achieves comparable or better fscore than existing machine learning methods by means of extracting metrics from programs using scripts. The findings demonstrate the potential of metric approaches as practical alternatives, simplifying design pattern analysis in software development. Future research should explore the application of metric approaches in industry contexts.  \nIndex Terms—Design Pattern Detection, Metrics, Thresholds, Machine Learning  \nI. INTRODUCTION  \nA design pattern provides a general and repeatable solution to a recurring problem in software design. Utilizing a design pattern when implementing or enhancing existing code facilitates the creation of a structure that can be easily expanded, comprehended, and maintained over time. While numerous design patterns exist for various programming languages, the 23 Gang-of-Four (GoF) design patterns are particularly renowned for their extensive use, especially in object-oriented design [1] . Typically, design patterns comprise classes that outline the roles and capabilities of objects.  \nUnderstanding existing source code or programs from large corporations or open-source projects can be daunting, particularly when design patterns are developed without explicit class names, comments, or documentation. Manual detection of design patterns in existing programs often proves to be labour-intensive and potentially error-prone, especially in the case of larger systems where the complexity of the task may lead to overlooked patterns. In response to these challenges, pattern detection research and software have been developed to automate design pattern detection [2] .  \nKramer and Prechelt pioneered an approach to design pattern detection [3] th","cbCaigyrZk77ri77","https://ap.wps.com/l/cbCaigyrZk77ri77","pdf",581188,1,11,"English","en",105,"# Abstract\n# Index Terms\n# Introduction\n## Design patterns and automation needs\n## Prior work in detection approaches\n## Research objective and scope\n## Evaluation methodology and datasets","[{\"question\":\"Why is machine learning challenging for design pattern detection?\",\"answer\":\"Machine-learning models require extensive training and large labeled datasets. These constraints make implementation difficult compared with simpler alternatives.\"},{\"question\":\"What is the main focus of the thesis?\",\"answer\":\"The thesis evaluates a metric-based approach for detecting three GoF design patterns—Singleton, Adapter, and State—and compares its accuracy to an existing machine learning approach.\"},{\"question\":\"How are the approaches evaluated in the study?\",\"answer\":\"The metric approach uses eleven code metrics and pattern-specific guiding questions, and both approaches are tested on eighteen open-source repositories in Java and C++ to assess detection accuracy.\"}]","Investigating the Accuracy of Metric-Based versus Machine Learning Approaches in Detecting Design Patterns - Bachelor of Science Thesis | PDF",1785682996,28,{"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},"investigating-the-accuracy-of-metric-based-versus-machine-learning-approaches-in-detecting-design-patterns-bachelor-of-science-thesis","",{"@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/investigating-the-accuracy-of-metric-based-versus-machine-learning-approaches-in-detecting-design-patterns-bachelor-of-science-thesis/118315/",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-02",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 machine learning challenging for design pattern detection?","Question",{"text":75,"@type":76},"Machine-learning models require extensive training and large labeled datasets. These constraints make implementation difficult compared with simpler alternatives.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"What is the main focus of the thesis?",{"text":80,"@type":76},"The thesis evaluates a metric-based approach for detecting three GoF design patterns—Singleton, Adapter, and State—and compares its accuracy to an existing machine learning approach.",{"name":82,"@type":73,"acceptedAnswer":83},"How are the approaches evaluated in the study?",{"text":84,"@type":76},"The metric approach uses eleven code metrics and pattern-specific guiding questions, and both approaches are tested on eighteen open-source repositories in Java and C++ to assess detection accuracy.","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,135],{"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":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]