[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-122934-en":3,"doc-seo-122934-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},122934,4398048950312,"Violet","https://ap-avatar.wpscdn.com/avatar/400002538284de19e3c?_k=1778320343897328908",8,"Research & Report","GEML - A Grammar-based Evolutionary Machine Learning Approach for Design-Pattern Detection","Design patterns (DPs) are valued best practices, yet weak documentation reduces traceability and makes benefits difficult to see amid large codebases. Existing automatic detection methods often rely on rigid analyses of only software metrics or specific source-code properties. GEML introduces evolutionary machine learning that extracts human-readable, context-free-grammar-conformant rules, then uses a rule-based classifier to predict hidden DP implementations. Validated on multiple public DPs and extended to 15, it demonstrates effective, robust detection and includes parameter tuning plus a supporting tool.","GEML: A Grammar-based Evolutionary Machine Learning Approach for  \nDesign-Pattern Detection  \nRafael Barbudoa,, Aurora Ram􀀓􀀐reza,, Francisco Servantb,, Jos􀀓e Ra􀀓ul Romeroa,􀀃  \na Department of Computer Science and Numerical Analysis, University of C􀀓ordoba, 14071, C􀀓ordoba, Spain b Department of Computer Science, Virginia Tech, VA 24060, Blacksburg, USA  \nAbstract  \nDesign patterns (DPs) are recognised as a good practice in software development. However, the lack of appropriate documentation often hampers traceability, and their bene􀀌ts are blurred among thousands of lines of code. Automatic methods for DP detection have become relevant but are usually based on the rigid analysis of either software metrics or speci􀀌c properties of the source code. We propose GEML, a novel detection approach based on evolutionary machine learning using software properties of diverse nature. Firstly, GEML makes use of an evolutionary algorithm to extract those characteristics that better describe the DP, formulated in terms of human-readable rules, whose syntax is conformant with a context-free grammar. Secondly, a rule-based classi􀀌er is built to predict whether new code contains a hidden DP implementation. GEML has been validated over 􀀌ve DPs taken from a public repository recurrently adopted by machine learning studies. Then, we increase this number up to 15 diverse DPs, showing its e􀀋ectiveness and robustness in terms of detection capability. An initial parameter study served to tune a parameter setup whose performance guarantees the general applicability of this approach without the need to adjust complex parameters to aspeci􀀌c pattern. Finally, a demonstration tool is also provided.  \nKeywords:  \ndesign pattern detection, reverse engineering, machine learning, associative classi􀀌cation, grammar-guided genetic programming  \n1. Introduction  \nDesign patterns (DPs) are reusable template solutions that address recurrent software-design problems. The adoption of DPs is a best practice for programmers with the goal of improving the quality of software products — in terms of their maintainability, elegance, 􀀍exibility and understandability (Gamma et al. , 1995) . Given such bene􀀌ts, and considering that manual inspection is an error-prone and time-consuming process, automatic Design Pattern Detection (DPD) has become a prominent area in the reverse-engineering research 􀀌eld (Bafandeh Mayvan et al., 2017) . By automatically  \ncase, the code structures de􀀌ning DPs need to be predetermined by experts into a knowledge-base, as they usually are speci􀀌c to the codebase of study. Having the expert de􀀌ned these code structures may impose rigidity to the detection technique, and design patterns should be reinterpreted for particular contexts.  \nTo reduce this limitation, machine learning (ML) techniques were proposed for DPD, e.g., Ferenc et al. (2005) . These techniques are more easily adapted to di􀀋erent codebases because they learn from a collection of representative examples — and thus can recognise diverse implementations by simply replacing or extending such analysed collection of examples. In particular, ML-based ap-  \narXiv :2401 .07042v 1 [ cs . SE] 13 Jan 2024  \nidentifying the adoption of DPs, DPD techniques can improve the understanding of the design decisions in software systems, as well as the processes of redocumenting them, reimplementing them, and reusing them.  \nDi􀀋erent techniques have been proposed in the research literature to automate DPD, most of which search for particular structures in static code (Mayvan and Rasoolzadegan, 2017) . In this  \n􀀃 Corresponding author. Tel. +34 957 21 26 60  \nEmail addresses: rbarbudo@uco .es (Rafael Barbudo), aramirez@uco .es (Aurora Ram􀀓􀀐rez), fservant@vt .edu (Francisco Servant), [jrromero@uco.es](jrromero@uco.es) (Jos􀀓e Ra􀀓ul Romero)  \nproaches provide mechanisms to learn the structural and behavioural properties of the source code, as well as software metrics, that best describe the DP. Even so, d","cbCailfv8yTfS9x6","https://ap.wps.com/l/cbCailfv8yTfS9x6","pdf",680548,1,27,"English","en",105,"# Abstract\n# Introduction\n## Design patterns and automatic detection challenges\n## Motivation for GEML\n## Proposed approach: grammar-guided evolutionary learning","[{\"question\":\"What problem does GEML target in design pattern detection?\",\"answer\":\"GEML targets the limitations of current methods, which often depend on rigid analyses and may require specific parameter tuning, making them harder to apply in practice.\"},{\"question\":\"How does GEML represent what it learns about design patterns?\",\"answer\":\"GEML uses an evolutionary algorithm to extract characteristics expressed as human-readable rules whose syntax follows a context-free grammar.\"},{\"question\":\"How is new code classified by GEML?\",\"answer\":\"GEML builds a rule-based classifier that predicts whether the input code contains a hidden design pattern implementation based on the extracted rules.\"}]","GEML - A Grammar-based Evolutionary Machine Learning Approach for Design-Pattern Detection | PDF",1785813765,68,{"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},"geml-a-grammar-based-evolutionary-machine-learning-approach-for-design-pattern-detection","",{"@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/geml-a-grammar-based-evolutionary-machine-learning-approach-for-design-pattern-detection/122934/",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-04",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},"What problem does GEML target in design pattern detection?","Question",{"text":75,"@type":76},"GEML targets the limitations of current methods, which often depend on rigid analyses and may require specific parameter tuning, making them harder to apply in practice.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does GEML represent what it learns about design patterns?",{"text":80,"@type":76},"GEML uses an evolutionary algorithm to extract characteristics expressed as human-readable rules whose syntax follows a context-free grammar.",{"name":82,"@type":73,"acceptedAnswer":83},"How is new code classified by GEML?",{"text":84,"@type":76},"GEML builds a rule-based classifier that predicts whether the input code contains a hidden design pattern implementation based on the extracted rules.","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"]