Details

Detekcija načrtovalskih vzorcev v kodi z uporabo ontologije in LLM
ID Gajšek, Urban (Author), ID Poženel, Marko (Mentor) More about this mentor... This link opens in a new window

.pdfPDF - Presentation file, Download (1,08 MB)
MD5: 708889481B5D1DADAAA94B9346ED4E8F

Abstract
Načrtovalski vzorci opisujejo ponavljajoče se rešitve pri načrtovanju program- ske opreme. V nalogi razvijemo program za zaznavanje načrtovalskih vzorcev v kodi C#. Kodo s platformo Roslyn pretvorimo v graf dejstev v obliki osebek–povedek–predmet, poizvedbe pa v njem iščejo kandidate za vseh 23 načrtovalskih vzorcev skupine Gang of Four. Neobvezna semantična stopnja z velikim jezikovnim modelom presodi, ali kandidat izraža razločevalni na- men načrtovalskega vzorca. Najdbe vsebujejo vloge udeležencev v zaznanem načrtovalskem vzorcu in mesta v kodi, izvoziti pa jih je mogoče v več strojno berljivih oblikah. Sistem ovrednotimo na 40 ročno označenih enotah iz sedmih resničnih odprtokodnih projektov v jeziku C#, objavljenih na GitHubu, za katere je vnaprej določeno, katere načrtovalske vzorce vsebujejo. Strukturni detektorji pri ločenem preverjanju na 23 lastnih in 22 zunanjih učbeniških primerih dosežejo popoln rezultat, na evalvacijskem korpusu označenih prime- rov pa mikrooceno F1 = 0,667. Ko strukturne kandidate na isti kodi dodatno preveri veliki jezikovni model, se mikroocena F1 zviša na 0,828. Rezultat naloge je uspešen prikaz koncepta hibridnega zaznavanja načrtovalskih vzorcev in je lahko osnova za njegov nadaljnji razvoj.

Language:Slovenian
Keywords:načrtovalski vzorci, statična analiza kode, SPARQL, RDF, ontologije, Roslyn, veliki jezikovni modeli
Work type:Bachelor thesis/paper
Organization:FRI - Faculty of Computer and Information Science
Year:2026
PID:20.500.12556/RUL-187358 This link opens in a new window
Publication date in RUL:10.09.2026
Views:85
Downloads:18
Metadata:XML DC-XML DC-RDF
:
Copy citation
Share:Bookmark and Share

Secondary language

Language:English
Title:Design Pattern Detection in Source Code Using an Ontology and Large Language Models
Abstract:
Design patterns describe recurring solutions to software design problems. In this thesis, we develop a tool for detecting design patterns in C# code. Using the Roslyn platform, the code is transformed into a graph of facts represented as subject–predicate–object triples, which is then queried to find candidates for all 23 Gang of Four patterns. An optional semantic stage uses a large language model to determine whether a candidate expresses the intent that distinguishes the pattern. The findings identify the roles of participants in the detected pattern and their locations in the code, and can be exported in several machine-readable formats. We evaluate the system on 40 manually labelled units from seven real-world open-source C# projects published on GitHub. In separate correctness checks, the structural detectors achieve a perfect result on 23 bundled and 22 external textbook examples; on the evaluation corpus of manually labelled examples, they achieve a micro F1 score of 0.667. When the structural candidates from the same code are additionally verified by a large language model, the micro F1 score increases to 0.828. The thesis presents a successful proof of concept for hybrid design pattern detection and provides a foundation for its further development.

Keywords:design patterns, static code analysis, SPARQL, RDF, ontologies, Roslyn, large language models

Similar documents

Similar works from RUL:
Similar works from other Slovenian collections:

Back