Generating Use Case Diagrams from User Stories Using Large Language Models

Abdelkareem M. Alashqar *

Faculty of Information Technology, Islamic University of Gaza, P.O. Box 108, Gaza, Palestine.

*Author to whom correspondence should be addressed.


Abstract

Background: While user stories are effective for defining features and supporting release planning in agile software engineering, they do not provide a comprehensive view of the system being developed. UML use case diagrams address this limitation by providing a visual representation of the overall system. Large language models (LLMs) have recently been adopted to support software modeling, mainly for generating UML models such as use case diagrams.

Aim: This paper proposes a multistep methodology, guided by well-designed prompts, that enables LLMs to generate UML use case diagrams from user stories.

Method: The methodology consists of three sequential processing steps, each guided by a well-designed prompt and processed progressively by four LLMs: ChatGPT, Gemini, Claude, and DeepSeek, to generate the final scripts of the use case diagrams from user stories. The performance of the four LLMs is evaluated using an inter-LLM agreement approach to assess their consistency.

Results: The experimental results of applying the multistep methodology to the four LLMs across six datasets show high consistency among them in generating use case diagrams from user stories. The highest inter-LLM agreement values achieved are 95.88%, 99.1%, and 100% for Step 1, Step 2, and Step 3 of the methodology, respectively.

Conclusions: LLMs can consistently extract and transform user stories into structured UML representations, and well-designed prompts reduce variability and produce high agreement across models. Although a preliminary qualitative semantic evaluation was achieved, this study remains focused on consistency among LLMs.

Keywords: Requirements engineering, user stories, UML, use case diagrams, PlantUML, large language models


How to Cite

Alashqar, Abdelkareem M. 2026. “Generating Use Case Diagrams from User Stories Using Large Language Models”. Journal of Engineering Research and Reports 28 (6):227-47. https://doi.org/10.9734/jerr/2026/v28i61925.

Downloads

Download data is not yet available.