arrow
Return

DPS: Design pattern summarisation using code features

delete2025-12-29
delete0
PRE
AI
N
Najam Nazar *
S
Sameer Sikka
C
Christoph Treude
DOI:10.1007/s10664-025-10788-xdelete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Automatic summarisation has been used effectively in recent years to condense texts, conversations, audio, code, and various other artefacts. A range of methods, from simple template-based summaries to complex machine learning techniques—and more recently, large language models—have been employed to generate these summaries. Summarising software design patterns is important because it helps developers quickly understand and reuse complex design concepts, thereby improving software maintainability and development efficiency. However, the generation of summaries for software design patterns has not yet been explored. Our approach utilises code features and JavaParser to parse the code and create a JSON representation. Using an NLG library on this JSON representation, we convert it into natural language text that acts as a summary of the code, capturing the contextual information of the design pattern. Our empirical results indicate that the summaries generated by our approach capture the context in which patterns are applied in the codebase. Statistical evaluations demonstrate that our summaries closely align with human-written summaries, as evident from high values in the ROUGE-L, BLEU-4, NIST and FrugalScore metrics. A follow-up survey further shows that DPS summaries were rated as capturing context better than human-generated summaries. Additionally, a time‑based task shows that the summaries reduce the time required for developers to understand design patterns compared with their absence. To our knowledge, this work presents the first automated approach to summarising software design patterns by linking pattern-detection features with natural-language generation. Unlike existing design-pattern detection or code summarisation methods that address these tasks separately, DPS introduces a feature-driven integration that converts detected pattern structures into contextual summaries describing the roles, relationships, and usage intent of each pattern instance.
Keywords:
Design patterns
Code features
Summarisation
JSON
JavaParser

Journal

Empirical Software Engineering cover
Empirical Software Engineering
IF:
3.6
Papers:
2.0K
Citations:
5.3K

Organization

S
School of Computer and Mathematical Sciences
Scholars:
5
Papers: 4
Citations: 0
S
School of Computing and Information Systems
Scholars:
40
Papers: 28
Citations: 4