A Pilot Study on Detecting Software Design Patterns with Large Language Models: An Empirical Evaluation
Oishik Chowdhury, Bastin Tony Roy Savarimuthu, Sherlock A. Licorish

TL;DR
This study evaluates the ability of large language models to detect software design patterns in source code, comparing different models and prompts to assess their effectiveness and potential for aiding software development.
Contribution
It provides an empirical evaluation of four large language models and ensemble methods for detecting five common design patterns in source code.
Findings
NextCoder and Gemma 3 outperform other models in accuracy.
Ensemble approaches improve detection efficiency.
LLMs show promise for automatic design pattern recognition.
Abstract
Design patterns provide reusable solutions to recurring software design problems. Automatically detecting these patterns in source code can help bootstrap new developers' understanding of unfamiliar software system architectures, and can help experienced developers to quickly identify and rectify potential quality issues. While many prior research works have explored graph based and machine-learning based detection techniques, this work evaluates the design pattern recognition capabilities of four Large Language Models and two ensemble approaches consisting three out of the four models. We also compare their performance when prompted with a) Source code, b) PlantUML representation of source code, and c) Text-based descriptions of the source code. We investigate the detection of five design patterns: singleton, adapter, bridge, composite and decorator. Our preliminary results indicate…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
