LLM-Based Class Diagram Derivation from User Stories with Chain-of-Thought Promptings.
Abstract
In agile requirements engineering, user stories are the primary means of capturing project requirements. However, deriving conceptual models, such as class diagrams, from user stories requires significant manual effort. This paper explores the potential of leveraging Large Language Models (LLMs) and a tailored Chain-of-Thought (CoT) prompting technique to automate this task. We conducted a comprehensive preliminary study to investigate different prompting techniques applied to the task. The study involved comparing LLM-based approaches with guided and unguided human extraction to evaluate the effectiveness of the proposed LLM-based techniques. Our findings demonstrate that LLM-based approaches, particularly when combined with well-crafted few-shot prompts, outperform guided human extraction in identifying classes. However, we also identified areas of suboptimal performance through qualitative analysis. The proposed CoT prompting technique offers a promising pathway to automate the derivation of class diagrams in agile projects, reducing the reliance on manual effort. Our study contributes valuable insights and directions for future research in this field. Index Terms-Requirements engineering, user story, large language models, chain of thought prompting I. I NTRODUCTION Requirements engineering (RE) serves as the foundation for the Software Engineering (SE) process, enabling the effective development of software systems. In agile RE practices, user stories have emerged as a highly popular technique for capturing requirements from a user's perspective [1]. These user stories play a central role as artifacts that guide the subsequent stages of software development [2]. Notably, user stories can undergo refinement to transform them into more detailed and specific specifications [3]. One effective approach for this refinement process is the derivation of conceptual models, such as Unified Modeling Language (UML) diagrams [4]. Bragilovski et al. [3] proposed guidelines aimed at enhancing flexibility and reducing cognitive effort in the task of translating user stories into UML class diagrams. However, despite these advancements, human involvement continues to be necessary. L