Skip to Content
SystemsSystems
  • Article
  • Open Access

19 September 2026

A Unified Intelligent Framework for SysML Use Case Diagram Modeling and Verification

,
,
and
Fédération ONERA - ISAE-SUPAERO - ENAC, Université de Toulouse, 31055 Toulouse, France
*
Author to whom correspondence should be addressed.
Systems2026, 14(9), 1170;https://doi.org/10.3390/systems14091170 
(registering DOI)
This article belongs to the Special Issue Model-Based Systems Engineering (MBSE) for Complex Systems

Highlights

Please indicate how your work links to systems science via your contributions to systems practice, theory, and/or methodology.
  • This work brings together three complementary techniques so to better assist in the development of SysML Use Case Diagrams.
  • Such intelligent modeling is enabled through rule-based verification, LLM-assisted natural language extraction, and hybrid Case-Based Reasoning.
What are the main findings and/or the implications of the main findings?
  • Initial experiments indicate that the retained approach shows promising performance in detecting modeling violations and retrieving relevant cases.
  • Future research and further evaluation of the approach will mainly focus on LLM extraction robustness, scalability and interoperability.

Abstract

The increasing complexity of systems within Model-Based Systems Engineering (MBSE) environments has made structured and reliable use case modeling critically important. Existing approaches to SysML Use Case Diagram modeling and verification remain fragmented, addressing generation, validation, or reuse in isolation. This paper presents UCDForge, a unified intelligent framework combining a rule-based verification engine, an LLM-assisted extraction pipeline, and a hybrid Case-Based Reasoning mechanism integrating pyCBR and myCBR for SysML Use Case Diagram modeling and verification. The verification module enforces structural, spatial, linguistic, and relationship rules against XML diagrams of the open-source toolkit TTool, while the generation module transforms natural language descriptions into standards-compliant diagrams through LLM extraction, hybrid CBR retrieval, and human-in-the-loop refinement. As an exploratory research contribution, the framework shows promising initial results in both violation detection and relevant case retrieval, suggesting its potential as a reliable and adaptive modeling assistant within MBSE environments.

1. Introduction

In the evolving landscape of engineering and complex systems, Model-Based Systems Engineering (MBSE) has emerged as a promising way forward for enhancing engineering design and architecture, where SysML serves as one of the main modeling languages and a backbone for modeling such systems [1].
In the context of designing complex systems, Use Case Diagrams (UCDs) hold significant value, especially during the early stages of modeling. The purpose of UCDs is to provide a high-level operational view of the functions performed by the system, which would be decomposed in later stages [2]. Since the overall quality of the model heavily depends on the structure and quality of the diagrams developed upfront, early-stage SysML models such as UCDs serve as the entry point and could greatly influence the downstream system architecture and design. In many cases, modelers who encounter problems during later stages are required to revisit the UCDs and refine them, resulting in increased cost, time, and development effort.
Since Systems Engineering involves multiple stakeholders and cross-disciplinary teams, there exists a greater margin for ambiguity if not modeled properly. Despite their seemingly simple appearance, UCDs pose challenges in maintaining coherence between different teams. Modelers often struggle with defining correct relationships, misuse of «include» and «extend» constructs, omit essential semantic rules, assign inconsistent names to actors and use cases, and leave dangling or unconnected elements [3,4]. Differences in individual interpretation further lead to misconceptions and inconsistencies [5], reducing the uniformity of the model and complicating collaboration, particularly when the diagram serves as a reference for further functional or architectural design.
The major cause of the problems stated above is the lack of a unified intelligent framework capable of guiding novice and experienced users in modeling UCDs while adhering to standard rules. It is essential that defects are detected and removed before they propagate to subsequent development phases, where their detection and removal become more expensive [6]. The growing complexity of systems, combined with extensive documentation and long requirement specifications, do not adequately account for human cognitive limitations. Expecting individuals to absorb large volumes of information and process it accurately increases the likelihood of errors and inconsistencies.
The goal of this paper is to present some exploratory research that was done with the aim to progress and cover these issues step by step. Similarly to the approach presented in [7], a combination of different techniques was made to address the identified issues. In this case, rule-based reasoning, large language model (LLM)-assisted extraction (e.g., see [8]), and case-based reasoning (CBR) were selected and were combined in an experimental tool, UCDForge, that will be presented in this paper. The overall aim was to support both verification of existing models and the generation of new use case diagrams from natural language descriptions of systems. With this in mind, rule-based reasoning was selected for its possibilities to implement confirmed knowledge in the form of rules. The use of CBR was investigated so as to be able to learn from previous designs (in our case, UCDs). And LLMs were selected so as to build upon their capacities to extract knowledge. Without loss of genericity, in this work, SysML use case diagrams are represented using TTool1, an open-source SysML modeling environment that stores models in an XML-based format and supports model creation. With the arrival of SysML V22, that has a defined textual notation, this opens up possibilities for the future to move from XML to the new SysML V2 notation and make such features available for other tools as well. The novelty in this paper lies therefore in the combination of three complementary techniques to better support the development of use case diagrams.
The paper is organized as follows. Section 2 presents the background and related work, covering use case diagram modeling, case-based reasoning, and existing approaches along with their limitations. The overall system architecture, experimental setup, and knowledge base design are presented in Section 3. The modular architecture of UCDForge, including both the generation and verification workflows, is also detailed in this section. Representative case studies are presented in Section 4, followed by results and a discussion in Section 5. Finally, Section 6 concludes the paper and outlines directions for future work.

3. Proposed Approach

To address the challenges mentioned in the previous section, this paper introduces UCDForge, a unified intelligent framework for SysML use case diagram generation and verification. The framework consists of two interconnected modules: a generation workflow that transforms system descriptions into structured use case diagrams using LLM-assisted extraction and hybrid Case-Based Reasoning, and a verification workflow that evaluates existing diagrams using structural, semantic, and linguistic validation rules. Together, these modules provide guided support for both model construction and quality assessment within MBSE environments.

3.1. Experimental Setup and Data Collection

UCDForge is implemented in Python version 3.10 with a Streamlit3-based web interface that supports interactive generation and verification workflows for both modules. XML model data is processed using ElementTree4, while natural language processing is supported through spaCy5, NLTK6, and Flair7 for grammatical and structural analysis. A MySQL knowledge base managed through PyMySQL8 supports case storage, retrieval, and reuse within the generation workflow.
To support the Case-Based Reasoning capabilities of UCDForge, a structured knowledge base containing more than 50 validated use case diagrams was developed from academic publications, public modeling examples, and engineering case studies. Each case stores core modeling elements including system names, actors, use cases, relationships, and domain information. For hybrid retrieval, cases are represented in both semantic and symbolic forms using precomputed embeddings and structured attributes, allowing UCDForge to retrieve semantically related and structurally similar diagrams during generation.
UCDForge includes a session persistence mechanism that allows designers to save and restore the workflow state at any stage of the generation process, supporting interrupted and iterative modeling activities without restarting the workflow. Sessions are stored using a dedicated UCDForge XML format that preserves system descriptions, extracted elements, relationships, retrieval outputs, workflow progress, and the previously generated TTool XML file. During restoration, the saved session is parsed and reloaded into the wizard, allowing users to resume partially completed modeling tasks while preserving all intermediate work.

3.2. Modular System Architecture

UCDForge follows a modular architecture designed to separate generation and verification workflows into interconnected system components. This modular structure improves scalability, maintainability, and workflow organization while allowing each component to operate within a unified modeling environment. The overall system combines Natural Language Processing, Large Language Models, Case-Based Reasoning, and rule-based verification techniques to support intelligent use case diagram generation and verification.

3.2.1. Generation Module

The generation module serves as the primary intelligent modeling component of UCDForge. Its objective is to transform unstructured system descriptions into structured use case diagrams through a guided and semi-automated workflow.
User Input
The module accepts multiple forms of input including plain text descriptions, PDF documents, and previously developed UCDForge custom modeling files serialized in XML format. Once the input is received, pre-processing operations are applied to normalize and extract textual content before forwarding the information to the Large Language Model for extracting relevant modeling elements.
LLM Extraction Pipeline
The extraction pipeline is responsible for transforming pre-processed system descriptions into modeling elements required for drafting use case diagrams. During this stage, the Large Language Model analyzes the input text to identify the system name, primary actors, secondary actors, use case, domains, and potential relationships between modeling components. These extracted elements are displayed to the user for review and refinement.
To support different deployment environments and computational constraints, UCDForge integrates two interchangeable Large Language Model execution strategies consisting of cloud-based inference and local offline inference.
The cloud-based mode uses Google’s Gemma 3 27B model9 through the Google Generative Language REST API10, providing strong contextual reasoning and efficient processing of complex engineering descriptions without requiring high-performance local hardware. On the other hand, local inference is supported through LM Studio11 using OpenAI12-compatible endpoints, where models such as Mistral 7B can be executed directly on the user’s machine. This supports offline processing, improved privacy, and secure handling of sensitive engineering data. Together, these deployment options allow UCDForge to operate across research and industrial environments with different privacy, infrastructure, and computational requirements.
The extraction workflow as shown in Figure 3 applies different processing strategies depending on the size of the input document. Smaller textual inputs are processed through direct extraction using a single inference request. For moderately sized engineering documents, the software applies a Recursive Refine strategy in which overlapping document sections are processed iteratively, with partial extraction results forwarded across stages to preserve contextual continuity and progressively refine extracted modeling elements. For very large engineering specifications, a semantic RAG-based condensation stage is applied prior to Recursive Refine processing, where document sections are embedded, ranked by modeling relevance, and filtered before iterative extraction to reduce unnecessary context while preserving modeling-relevant information.
Figure 3. Extraction workflows for different document sizes: (a) Direct extraction for small sized documents, (b) Recursive refine strategy for medium sized documents and (c) Semantic RAG-based condensation for large and very large documents.
The intermediate JSON representation output from LLM is forwarded to the hybrid CBR workflow, where the extracted modeling elements are used to retrieve similar use case diagram artifacts from the knowledge base for generation support.

3.2.2. Hybrid Case-Based Retrieval

After the extraction stage, the identified modeling elements are passed to the hybrid Case-Based Retrieval module. This module improves the quality of generation by finding previously validated use case diagrams that are structurally or semantically similar to the current system description. Instead of depending only on direct language model generation, the software reuses past engineering knowledge stored in the UCDForge knowledge base.
The retrieval workflow combines two complementary reasoning strategies consisting of semantic retrieval (pyCBR) and symbolic retrieval (myCBR). This hybrid approach allows the software to identify both conceptually related cases and structurally similar cases, even when different terminology or naming conventions are used across system descriptions. Both retrieval workflows are executed in parallel, and their outputs are merged to produce a unified ranked list of candidate cases for user selection. By default, the highest ranked case is automatically selected as the primary reference case for the subsequent generation workflow.
The semantic retrieval component is implemented using pre-trained sentence transformer embedding models. Paragraph-level embeddings are generated using BAAI/bge-large-en-v1.513, while shorter embeddings are generated using all-mpnet-base-v214. During extraction, system descriptions, actors, use cases, and domain information are converted into vector embeddings and compared against stored knowledge base cases using cosine similarity. Semantic comparisons are performed across system names, descriptions, actors, use case, and domain representations to identify conceptually relevant use case diagrams.
To improve retrieval robustness, semantic similarity is complemented by lexical similarity and synonym expansion. Jaccard similarity and predefined synonym repositories reduce sensitivity to vocabulary variation and inconsistent naming.
Weighted similarity scoring is applied across multiple modeling attributes, including titles, descriptions, actors, use case, and domains. The weighting configuration was refined through engineering judgment and iterative retrieval evaluation during system development, with primary emphasis placed on use case similarity since it most directly represents system functionality and behavioral intent.
Query and candidate use cases are compared using a symmetric one-to-one matching strategy based on cosine similarity as shown in Figure 4. Each use case is paired with its most similar unmatched counterpart in both directions, and the final similarity score is computed as the average of the forward and backward matching scores. Once matched, use cases are excluded from further assignments, while unmatched elements contribute zero similarity during score aggregation. This approach penalizes unmatched functionality and favors cases with balanced functional similarity.
Figure 4. Symmetric one to one semantic matching process used for forward and backward use case similarity evaluation during hybrid retrieval.
Actor similarity was also assigned significant influence because actor interactions contribute strongly to behavioral interpretation and system usage context during retrieval, and were computed using a similar similarity evaluation process. The similarity of the domain and description was assigned moderate influence to support contextual relevance during retrieval. Lower weights were assigned to system name similarity and lexical similarity since these attributes are more sensitive to naming variation and contribute less to overall modeling correspondence. This weighted scoring strategy improves retrieval accuracy by prioritizing modeling elements with greater functional significance.
The symbolic retrieval component runs in parallel through the myCBR framework as shown in Figure 5. Historical use case diagram cases from the UCDForge knowledge base are exported into a myCBR project structure, where each case is represented as a collection of string, symbol, and numeric attributes covering system names, descriptions, actors, use cases, domains, relationship categories, and structural element counts. System names are compared using trigram similarity, while system descriptions are evaluated using Jaro-Winkler similarity to capture partial lexical similarity.
Figure 5. Overall hybrid Case-Based Retrieval workflow combining semantic retrieval (pyCBR), symbolic retrieval (myCBR) and result integration.
Actor names, use case labels, domain descriptors, and relationship types are stored as symbol attributes. Rather than storing these as separate entries, values belonging to the same attribute category are concatenated into combined textual descriptors.
During retrieval, the myCBR engine compares these descriptors between the query and stored cases using symbolic equality matching, allowing broader structural and lexical comparison rather than fine-grained element-level matching.
Structural features including primary actor count, secondary actor count, use case count, and relationship count are stored as numeric attributes and evaluated using a polynomial difference function. During retrieval, query elements are converted into a flat attribute map and sent to the myCBR REST engine, where local similarity scores are computed and merged into a final relevance score using a weighted amalgamation function. Greater weight is assigned to use case and actor attributes to align with the priorities of the semantic retrieval workflow.
Although semantic retrieval focuses on contextual similarity through embeddings, symbolic retrieval emphasizes structural and lexical correspondence, making it effective for identifying cases with similar modeling patterns. Once both retrieval workflows complete, the pyCBR and myCBR engines independently produce ranked candidate cases that are displayed side by side in the interface. The highest-scoring case is pre-selected by default, while users may review both ranked outputs and select the most suitable case before proceeding to case adaptation.

3.2.3. Case Adaptation and Suggestion Refinement

After a case is selected during retrieval, the software performs case adaptation to refine the extracted modeling elements using information from the selected knowledge base case. The workflow compares user-extracted actors and use cases with their corresponding elements in the retrieved case.
Semantic similarity between labels is computed using sentence embeddings generated with all-mpnet-base-v2. A sentence embedding is a dense numerical vector representation that captures the semantic meaning of a text label, enabling similarity to be measured based on meaning rather than exact lexical matching. If a user-supplied label is sufficiently similar to a knowledge base label, the knowledge base label is suggested as a normalized alternative. Original user labels are never automatically replaced and remain unchanged unless the user explicitly accepts the suggestion.
Following label mapping, relationship definitions are updated using the generated mappings to preserve naming consistency across the adapted diagram. The software then identifies actors, use cases, and relationships from the retrieved case that are not already present in the user session and prepares them as reusable suggestions.
These suggested elements are presented as optional recommendations within the interface. Users may accept individual or all suggestions, or continue using only the originally extracted elements. Existing user elements are not removed or overwritten during this process. This suggestion-based adaptation strategy improves modeling consistency and reuse while preserving user control over the final use case diagram structure.

3.2.4. User Review, Refinement and Relationship Definition

Following case adaptation, the extracted elements are presented to the users for validation or any refinement if needed before proceeding further. Users can make changes as needed and may review, modify, add, or remove actors, use cases, and inferred relationships to improve the correctness and completeness of the model. This stage follows a human-in-the-loop strategy, where the final diagram structure remains under user supervision before proceeding to relationship definition and automatic generation.
After the review stage, users define and validate the relationships between actors and use cases before final diagram synthesis. The workflow supports association, include, extend, actor generalization, and use case generalization relationships, where relationships inferred during the LLM extraction stage are pre-loaded as initial suggestions for user review and refinement. Association relationships define interactions between actors and use cases, include relationships representing mandatory behavior, extend relationships capture optional conditional behavior, and generalization relationships represent inheritance between specialized and generalized modeling elements. Users may further add, modify, or remove relationships to improve structural correctness and modeling completeness before proceeding with generation. Extension relationships also support optional condition descriptions during relationship definition.
Basic structural consistency checks are enforced during the editing process to preserve SysML compliance and prevent invalid relationship configurations. In addition, the evolving model is continuously validated using the UCDForge verification engine, which evaluates the diagram against the implemented SysML use case modeling rules covering structural, spatial, linguistic, and relationship constraints. By detecting and reporting violations before export, the framework helps ensure that the resulting model remains compliant with the enforced SysML use case diagram semantics. Relationships such as include and extend cannot coexist between the same pair of use cases, while invalid self-referencing generalization relationships are automatically rejected.

3.2.5. Diagram Export, Verification and Knowledge Base Retention

After the relationship definition stage, confirmed modeling elements are converted into a TTool-compatible XML representation of the SysML v1 use case diagram. The generated XML additionally contains a reference diagram panel from the selected knowledge base case for direct comparison within TTool. Automatic verification is then performed, covering naming consistency, connectivity, relationship correctness and diagram arrangement, with findings reported as warnings and errors embedded within the XML file.
Beyond TTool XML, the workflow generates SVG representations alongside PlantUML-based SysML v1 and SysML v2 textual notations. The use of both TTool and PlantUML is intentional because they serve different purposes within the workflow. TTool XML provides a complete machine-readable representation that preserves the semantics of the model, structural information, and verification results, enabling subsequent analysis, validation, and model restoration. In contrast, PlantUML offers a lightweight textual notation that facilitates visualization, documentation, version control, and interoperability with external tools and development environments. The use of these two representations does not introduce methodological redundancy or additional modeling effort since both exports are automatically generated from the same internal model. Consequently, TTool supports formal analysis and model preservation, whereas PlantUML supports communication, collaboration, and exchange, providing complementary capabilities within the multi-format export framework. UCDForge additionally supports export through a custom session XML format for later restoration and refinement. Figure 6 presents the multi-format export and verification workflow adopted within UCDForge.
Figure 6. Multi-format diagram export and verification workflow used for generating validated SysML representations within UCDForge.
Users may optionally retain the finalized case within the knowledge base, storing embeddings, modeling elements, relationships, PlantUML notation, and the generated TTool XML for future hybrid retrieval, thereby completing the Case-Based Reasoning cycle.

3.3. Verification Module

In addition to the semi-automated generation workflow, UCDForge provides a dedicated verification module for analysing SysML v1 use case diagrams represented in the TTool XML format. The verification workflow allows users to upload previously created diagrams and evaluate their structural correctness, naming quality, connectivity, spatial arrangement, and relationship consistency through a guided multi-stage verification process.

3.3.1. File Upload and Pre-Verification

The verification workflow begins with the upload of a TTool compatible XML file containing one or more SysML v1 use case diagram panels. The software parses the XML structure to extract the core modeling elements, including the system boundaries, actors, use cases, spatial coordinates, and relationship definitions. During parsing, diagram panels are identified, modeling elements are classified according to their corresponding TTool component types, and connector relationships are resolved into association, include, extend, and generalization categories.
Before detailed verification begins, an initial structural integrity check ensures that each diagram panel contains exactly one system boundary together with at least one actor and one use case. Panels that do not satisfy these minimum structural requirements are excluded from further analysis. After successful extraction, the verification engine executes linguistic, structural, connectivity, and relationship verification operations in a pre-computation stage. The generated findings are then cached within the session to avoid repeated execution in later verification steps. The interface finally presents a summary of the extracted diagrams and identified modeling elements before detailed analysis begins.
After XML extraction and pre-verification, the workflow performs verification across system boundaries, actors, use cases, connectivity, and relationships. Linguistic analysis uses spaCy, WordNet, and NLTK, with context probing applied to improve the parsing reliability for short labels. Verification evaluates naming quality, grammatical correctness, semantic ambiguity, and casing consistency, while semantic similarity is computed using the all-MiniLM-L6-v215 embedding model.
Structural verification detects misplaced boundaries and isolated elements, while relationship verification validates association, include, extend, and generalization links through direction and compatibility checks. A human-in-the-loop review stage allows designers to confirm or correct detected relationships, with findings reported together with corrective guidance. The set of verification rules implemented by UCDForge is detailed in Table 2.
Table 2. Implemented Verification Rules within the UCDForge Verification Engine.

3.3.2. Verification Results and Recommendations

Once all verification stages are completed, the findings are aggregated into a unified analysis report that covers all UCD panels in the uploaded TTool SysML v1 XML file. The results are presented through summary and detailed views, grouping findings by severity and modeling category, including system boundaries, actors, use cases, and relationships. Each finding includes the affected element, diagnostic explanation, and severity classification, while semantically similar element pairs are duplicated to reduce redundant reporting.
After reviewing the results, the designer can export a verification-annotated TTool SysML v1 XML file. Verification findings are embedded as grouped activity diagram panels appended to the XML without altering the original diagram structure. Each issue is represented together with diagnostic information and corrective guidance, allowing the exported file to be directly reviewed within TTool alongside the original use case diagram.

4. Case Study

This section presents a walkthrough of the integrated framework through representative case studies for each module. Together, these cases cover the two primary usage scenarios of the framework and demonstrate its effectiveness. The module is demonstrated using a Cab Booking Application UCD.

4.1. System Description, LLM Extraction, and Hybrid CBR Retrieval

The generation workflow was initiated using a plain English description of a Cab Booking Application containing intentional spelling mistakes and ambiguities to simulate realistic user input conditions. After pre-processing, the description was forwarded to the LLM extraction pipeline, which identified the system name, actors, use cases, relationships, and domains without requiring formal modeling constructs from the user.
The hybrid CBR engine queried the knowledge base in parallel using pyCBR and myCBR, displaying both engines’ top matches side by side. The Cab Booking Application was returned as the top pyCBR match with a confidence score of 0.7371. Several cases appeared as common matches across both engines, indicating strong semantic and structural relevance. pyCBR consistently produced more relevant matches through semantic embedding similarity, while myCBR provided complementary symbolic retrieval through string-based matching.

4.2. Element Editing, CBR Suggestions, and Output Generation

Following case selection, CBR-suggested and LLM-extracted elements were merged and presented to the user for review, where actors, use cases, and relationships could be accepted, discarded or modified. This corresponds to the Reuse and Revise phases of the CBR cycle. Upon finalization, the software generated TTool XML, PlantUML, and SysML v2 notation from a unified internal representation, with an SVG preview rendered directly within the interface for visual inspection before export, as shown in Figure 7.
Figure 7. SVG Preview of Generated Cab Booking Application Use Case Diagram.
The generated TTool XML was subsequently evaluated using the verification module before being made available for export. The finalized diagram was then retained within the knowledge base, completing the retain phase of the CBR cycle. The reproduced TTool diagram shown in Figure 8 demonstrates that a plain English system description containing spelling mistakes and ambiguities can be transformed into a standards-compliant SysML Use Case Diagram through the proposed methodological framework.
Figure 8. Reproduced TTool Diagram—Finalized Cab Booking Application UCD.
The verification module was evaluated using a Satellite Operation System Use Case Diagram intentionally injected with structural, spatial, linguistic, and relationship errors to simulate common modeling mistakes.

4.3. XML Parsing and Element Extraction

The uploaded TTool XML file as shown in Figure 9 was automatically parsed, allowing the software to extract the actors, use cases, and connectors along with their associated spatial and structural data. Following extraction, the verification results for all categories were generated in advance, allowing users to navigate between verification stages without reprocessing the diagram.
Figure 9. Actor and Use Case Verification Results—Satellite Operation System.
The following modeling errors were deliberately introduced during evaluation. Actor-related issues included ambiguous naming (“Magesh”), the use of a verb as an actor name (“Repair”), incorrect title case formatting (“project engineer”), placement of an actor inside the system boundary (“Safety Engineer”), and duplicate actor naming (“Payload Operator”). Use case related errors included invalid naming structures such as non-verb beginnings (“Storage Module Recorder”), spelling errors (“Get Payload Status”), incorrect spatial placement outside the system boundary (“Store Power”), and semantic inconsistencies (“Send Stored Command”). Relationship-level errors included the incorrect use of include relationships where generalization relationships were more appropriate. Each actor and use case was evaluated against the enforced rules, with results colour-coded by severity as shown in Figure 10, and all deliberately introduced errors were successfully identified with the corresponding verification feedback.
Figure 10. Use Case Verification Results—Satellite Operation System.
The relationship validation stage analyzed the extracted connectors, identified potential relationship inconsistencies, and presented the results for user confirmation. The observed results are shown in Figure 11. The correction-annotated TTool XML was exported and opened within the TTool environment, where verification findings remained accessible alongside the original diagram, as shown in Figure 12.
Figure 11. Final Verification Results—15 Errors and 9 Warnings Detected.
Figure 12. Corrected UCD After Applying Verification Suggestions.

5. Results and Discussion

5.1. Overview, Performance Summary & Evaluation Metrics

The objective of this section is to present the experimental evaluation of the proposed framework across its two core modules: the UCD Verification Module and the UCD Generation Module, and observe how it fares when put to the test under various input conditions across different cases with different levels of correctness and ambiguity. Each module is evaluated independently through representative test cases, with results reported across the key performance dimensions of accuracy, recall, precision, and retrieval relevance.
The tests were conducted exhaustively across various domains from the database, for prompts of different sizes in an unbiased manner. The following results were observed:
The verification module was evaluated against a set of TTool XML diagrams of varying complexity and correctness. Please refer to Table 3. The number of rules enforced was 21. The CBR module was evaluated on retrieval relevance, suggestion acceptance rate and overall generation performance. Performance metrics are summarized in Table 4.
Table 3. Verification Engine Performance Metrics.
Table 4. Generation and CBR Performance Metrics.
To evaluate the performance of the verification module, three standard metrics were used: Precision, Recall, and F1 Score. Precision measures the proportion of flagged violations that were genuinely real, while Recall measures the proportion of actual violations successfully detected. The F1 Score is the harmonic mean of Precision and Recall, ensuring a high score is only achieved when both metrics are strong. In the verification context, high Precision indicates the software avoids incorrectly flagging valid elements, while high Recall indicates successful identification of actual modeling errors.
F 1 = 2 × Precision × Recall Precision + Recall

5.2. Verification and Generation Module Performance

The verification module achieved an F1 score of 97.5%, with a precision of 98.54% and a recall of 96.6%, indicating strong performance in structural and semantic validation. Actor naming violations, spelling inconsistencies, and relationship misuse were the most frequently identified issues. The 13.5% ambiguity rate suggests that some inconsistencies require contextual interpretation rather than strict binary classification, reducing cognitive burden and keeping the correction process focused.
The generation module showed promising results, as summarized in Table 4. Top-1 UCD match confidence refers to the similarity score of the highest-ranked diagram retrieved from the hybrid CBR engine, while Top-3 refers to the average confidence across the three most relevant retrieved diagrams. The hybrid CBR retrieval engine achieved a Top-1 UCD match confidence of 98.5% and a Top-3 match confidence of 82%, demonstrating consistent retrieval of relevant cases from the knowledge base. The extracted elements achieved a mapping accuracy of 92%, requiring minimal manual correction.

5.3. Some Observations

A consistent observation across all generation test cases is that pyCBR outperformed myCBR as the primary retrieval engine. Semantic retrieval produced more relevant matches than symbolic string matching, particularly when domain vocabulary varied across cases. myCBR’s role is better understood as a complementary signal, while cases retrieved strongly by both engines generally represented the strongest retrieval candidates. The 81.5% suggestion acceptance rate confirms that the knowledge base is well-curated and that the hybrid retrieval is returning genuinely relevant cases.
At the same time, the framework intentionally preserves a human-in-the-loop workflow. Rather than enforcing full automation, LLM extractions and CBR recommendations are presented as guided suggestions, allowing users to refine outputs based on domain knowledge and modeling intent. This positions the framework as an intelligent assistant rather than a replacement for the modeler, while also exposing users to validated modeling patterns that reinforce good modeling practices. The observed 1 % instability is attributed to inherent LLM variability, mitigated by requiring user review before diagram finalization.
The framework operationalizes the entire CBR cycle within every generation workflow. The retrieve phase identifies the most semantically and symbolically relevant past cases from the knowledge base, the reuse phase proposes their constituent elements as candidate actors, use cases and relationships for the new diagram, the revise phase requires direct user involvement to evaluate and refine these suggestions against the specific system being modeled, giving users flexibility, and the retain phase permanently stores the finalized and verified diagram back into the knowledge base for future retrieval.

5.4. Evaluation Dataset and Discussion on the Validation

The evaluation dataset was constructed from use case diagrams sourced from academic textbooks, published modeling examples, and engineering case studies, stored in the UCDForge knowledge base, serving as ground truth references for both module evaluations. Testing was conducted in two phases. In the first phase, violations covering all 21 enforced rule categories were systematically injected to ensure complete rule coverage across structural, linguistic, spatial, and relationship error types. The rule categories were informed by established literature on common UCD modeling errors, including [3,11,12], while additional categories were intentionally introduced to broaden coverage. Collectively, the 21 rules resonate with real-world modeling problems, ensuring that injected violations reflect genuine mistakes rather than arbitrarily constructed test cases. For the generation module, the hybrid CBR retrieval engine was repeatedly run across multiple system description inputs against the full knowledge base, evaluating whether the retrieval engine surfaced the most semantically and structurally relevant case for each input. This further motivated the inclusion of a human-in-the-loop stage before finalization. In the second phase, an informal test was conducted with a small group of fellow students and colleagues from both Systems Engineering and non-Systems Engineering backgrounds, who independently tested both the verification and generation modules by giving user inputs for generation and by introducing violations without prior knowledge of the rule categories, simulating realistic and unpredictable modeling mistakes and reducing author bias. The original diagrams served as ground truth, allowing direct comparison against both module outputs. The 355 violations represent the total across all evaluated diagrams, of which 343 were detected, yielding 338 true positives, 12 false negatives, and 5 false positives, producing the reported precision, recall, and F1 scores. A more rigorous evaluation involving formally recruited annotators and independent domain experts represents a direction for future work.
Furthermore, looking at the validation, it should be noted that confidence scores and correctness are not the same. Within this exploratory research project, the primary objective of this work was to demonstrate the feasibility and potential of integrating rule-based verification, LLM-assisted extraction, and hybrid CBR retrieval into a unified framework. A rigorous formal evaluation involving independent domain experts and expert scoring goes beyond the scope of this initial investigation. Regarding the reported metrics, the Top-1 confidence reflects the similarity score of the single best retrieved case, which naturally tends to be high as the retrieval engine identifies the most semantically and structurally relevant match. The reduction in Top-3 confidence is expected and reflects the increasing specificity and subjectivity of lower-ranked candidates, where matches become progressively less aligned with the input as retrieval extends beyond the single best case. Since the knowledge base spans a wide range of domains, lower-ranked candidates naturally represent increasingly distant systems, and this reduction in confidence is therefore a reflection of domain diversity rather than a limitation of the retrieval engine. This effect would naturally diminish with a larger and more densely populated knowledge base, where more closely related cases would be available across a wider range of domains. The elements mapping accuracy reflects the proportion of LLM-extracted actors and use cases that were successfully mapped to semantically equivalent elements in the retrieved knowledge base case, computed through a symmetric one-to-one semantic matching process where each extracted element is paired with its most similar counterpart in the KB case using sentence embeddings. Elements that do not meet the similarity threshold are retained as originally extracted and presented to the user for review, ensuring that unmatched elements remain under user supervision. Crucially, the subsequent steps of the workflow involve a deliberate human-in-the-loop design, where users review, modify, accept, or reject all extracted and suggested elements before diagram finalization. This design choice was intentional precisely because the retrieval and extraction outputs can be domain-specific or may not completely align with the user’s modeling intent and the human-in-the-loop stage ensures that the final diagram reflects validated user decisions rather than unchecked automated output, providing a practical correctness mechanism embedded within the workflow itself. Furthermore, every generated diagram is automatically passed through the verification module before export, enforcing structural, linguistic, spatial, and relationship rules to ensure that the final output satisfies a formally defined correctness criterion regardless of the retrieval confidence score.
During the development of the case retrieval component, several approaches were investigated for determining the relative importance of the different similarity dimensions. In particular, we experimented with data-driven weighting approaches, including logistic regression and a genetic algorithm for optimizing the retrieval weights. These experiments were conducted to determine whether automatically learned weights could consistently improve the ranking and retrieval of cases according to user preferences. Although these approaches were technically feasible, our experiments showed that they introduced considerable methodological and computational complexity without consistently producing rankings that corresponded to the cases users considered most relevant. In particular, the optimized weights were sensitive to the formulation of the relevance criterion and did not reliably reflect the preferences expressed through the actual case-retrieval task. This was especially problematic because our objective is not simply to classify pairs of cases as similar or dissimilar, but to retrieve and rank cases in a way that is meaningful and useful to the user. Consequently, rather than introducing an optimization procedure whose learned weights could be difficult to interpret and reproduce across datasets, we adopted a heuristic weighting strategy. The heuristic approach provides explicit and transparent retrieval weights, allows the contribution of each similarity dimension to be clearly understood, and proved more appropriate for the practical retrieval setting investigated in this work. We therefore consider the heuristic formulation a deliberate design choice resulting from our comparative experimentation, rather than an omission of alternative weighting methods. The implementation resources of the realised approach can be found here16. The repository contains the datasets used in the experiments, the original XML data, and the parsing scripts required to transform the XML data into the structures used by the retrieval system. The source code for the similarity calculations, retrieval process, and weighting configuration is also provided, allowing researchers to inspect and reproduce the experimental pipeline.

6. Conclusions and Perspectives

This paper presents an exploratory research project aiming to improve use case diagram design by bringing in techniques from artificial intelligence, namely rule-based reasoning, case-based reasoning and large-language models.
The selection of these three techniques was deliberate and motivated by the specific challenges identified in the related work. Rule-based verification was chosen because it provides explicit and non-negotiable enforcement of structural, linguistic, spatial, and relationship correctness constraints, ensuring that defined modeling rules are consistently applied regardless of how the diagram was generated. LLM-assisted extraction was selected because it handles natural language ambiguity, spelling variations, and informal phrasing that traditional NLP approaches do not always capture, allowing users to describe their systems freely in plain language without requiring formal modeling constructs or rigid input structures. Case-Based Reasoning (CBR) was chosen because it resolves new problems by retrieving and adapting solutions from previously solved similar problems, making it particularly well suited to domains where expert knowledge is difficult to formalise but historical examples are available. This makes CBR a natural fit for UCD modeling, where validated past diagrams can serve as reusable references for new modeling tasks.
Together, these three techniques address complementary aspects of the UCD modeling lifecycle: LLM-assisted extraction handles unstructured input, CBR retrieval grounds the output in validated knowledge, and rule-based verification ensures that the final diagram satisfies formally defined correctness criteria. As such, the novelty lies in the integration of these three complementary techniques, with each contributing a distinct capability that works in tandem with the others to better support the development of use case diagrams.
The first implementation has demonstrated potential to reduce modeling complexity and improves flexibility and adaptability. First assessment of the verification module and the generation module demonstrate strong performance, and some interoperability is enabled through the three-format export capabilities supporting TTool XML, PlantUML, and SysML v2.
With the encouraging results presented in this paper, come a set of important next research objectives, briefly highlighted below.
  • First of all, it is planned to include in future research expert scoring, element-level precision/recall, relation extraction accuracy, and diagram correctness score. In addition, the plan is to do detailed comparisons with LLM-only, rule-base-based, CBR-only and RAG-only baselines.
  • Secondly, LLM extraction may be affected by hallucinations, prompt sensitivity and changes in domain terms. This part has in the current research not yet been addressed, and in a next step the robustness of different LLMs, different prompts, different document lengths and different domain requirements will be done. The impact of LLM model choice on the extraction quality needs to be assessed. The goal will be to improve reproducibility through disclosure of prompts, extraction templates, and representative examples of successful and unsuccessful generations.
  • Thirdly, it would be interesting to go more in detail on deep semantic correctness, requirement coverage completeness, and cross-graph consistency for the verification module.
  • Also, in the current implementation, XML was used. This choice is due to the TTool native notation but does not allow for interoperability with other tools. Again, it concerns an exploratory research project, and interoperability was not a main driver in this first step. However, with the arrival of SysML V2, that has a defined textual notation, this issue will disappear. Also, we aim to turn to SysML V2 in future research, so that the approach links to other tools as well.
  • In the current state, the framework has a repository of approximately fifty validated use case diagrams. Although this is a good starting point, one needs to extend this repository and assess the impact on the operation of the framework (precision, knowledge-base growth, retrieval time, repeatability, scalability, domain transferability, retrieval degradation, etc.). In future research, we aim to address these issues and assess the effectiveness of the approach when confronted with large and heterogeneous industrial repositories.
  • Once these issues will have been addressed, research may turn to how generated and verified use case diagrams integrate into larger MBSE workflows involving architecture models, safety analyses, requirement models, verification plans, and digital thread concepts. These topics are very important, and deserve specific attention.

Author Contributions

Conceptualization, M.N.N., S.B., P.d.S.-S. and R.V.; Methodology, M.N.N., S.B. and R.V.; Software, M.N.N. and S.B.; Validation, M.N.N. and S.B.; Formal analysis, M.N.N., S.B. and P.d.S.-S.; Resources, R.V.; Writing—original draft, M.N.N. and S.B.; Writing—review & editing, M.N.N., S.B., P.d.S.-S. and R.V.; Supervision, P.d.S.-S. and R.V. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

SW Code and verification can be found in https://github.com/nachimageshnachi/UCDForge (accessed on 10 September 2026).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MBSEModel-Based Systems Engineering
SysMLSystems Modeling Language
UMLUnified Modeling Language
UCDUse Case Diagram
V&VVerification and Validation
NLPNatural Language Processing
LLMLarge Language Model
RAGRetrieval-Augmented Generation
CBRCase-Based Reasoning
BERTBidirectional Encoder Representations from Transformers
RBERule-Based Engine
OCLObject Constraint Language
OMGObject Management Group
SQLStructured Query Language
DBMSDatabase Management System
APIApplication Programming Interface
JSONJavaScript Object Notation
SVGScalable Vector Graphic
KBKnowledge Base

Notes

1
2
https://www.omg.org/sysml/sysmlv2/, accessed on 10 September 2026
3
Streamlit is an open-source Python framework for developing interactive web applications and user interfaces.
4
ElementTree is a Python library for parsing and manipulating XML documents.
5
spaCy is an open-source Natural Language Processing library used for tokenization, grammatical analysis, and linguistic processing.
6
NLTK (Natural Language Toolkit) is a Python toolkit providing linguistic resources and text-processing algorithms.
7
Flair is an NLP framework that provides contextual embeddings and sequence labeling models for language analysis.
8
PyMySQL is a Python library that enables applications to communicate with MySQL databases.
9
Gemma 3 27B is a large language model developed by Google for natural language understanding and generation tasks.
10
The Google Generative Language REST API provides cloud-based access to Google’s generative AI models through standard HTTP requests.
11
LM Studio is a desktop application for running LLMs locally using OpenAI-compatible interfaces.
12
OpenAI is based in San Francisco, USA
13
BAAI/bge-large-en-v1.5 is a sentence embedding model used to convert text into vector representations for semantic similarity computation.
14
all-mpnet-base-v2 is a pretrained sentence-transformer model used for generating semantic text embeddings.
15
all-MiniLM-L6-v2 is a lightweight sentence embedding model used to compute semantic similarity between text labels.
16
https://github.com/nachimageshnachi/UCDForge, accessed on 10 September 2026.

References

  1. INCOSE. Systems Engineering Body of Knowledge (SEBoK). 2023. Available online: https://www.sebokwiki.org/wiki/Main_Page (accessed on 10 September 2026).
  2. Cockburn, A. Writing Effective Use Cases; Addison-Wesley: Reading, MA, USA, 2001. [Google Scholar]
  3. Aquino, E.R.; de Saqui-Sannes, P.; Vingerhoeds, R.A. A Methodological Assistant for Use Case Diagrams. In Proceedings of the MODELSWARD 2020, Valletta, Malta, 25–27 February 2020. [Google Scholar]
  4. de Saqui-Sannes, P.; Vingerhoeds, R. Some Lessons Learned from Teaching SE and MBSE. In Proceedings of the 2025 IEEE International Systems Conference (SysCon), Montreal, QC, Canada, 7–10 April 2025. [Google Scholar] [CrossRef] [Scilit]
  5. Thalanki, P.K.; Maddukuri, V.K. Classifying Research on UML Model Inconsistencies with Systematic Mapping. Master’s Thesis, School of Computing, Blekinge Institute of Technology, Karlskrona, Sweden, 2013. [Google Scholar]
  6. Chren, S.; Buhnova, B.; Macak, M.; Daubner, L.; Rossi, B. Mistakes in UML Diagrams: Analysis of Student Projects in a Software Engineering Course. In Proceedings of the ICSE-SEET 2019, Montreal, QC, Canada, 25–31 May 2019. [Google Scholar] [CrossRef] [Scilit]
  7. Montero Jimenez, J.J.; Schwartz, S.; Vingerhoeds, R.; Grabot, B.; Salaün, M. Towards multi-model approaches to predictive maintenance: Systematic literature survey on diagnostics and prognostics. J. Manuf. Syst. 2020, 56, 539–557. [Google Scholar] [CrossRef] [Scilit]
  8. Wang, Y.; Ge, N.; Liu, J.; Cao, Z.; Chen, Z.; Hu, C. Generating SysML Behavior Models via Large Language Models: An Empirical Study. In Proceedings of the Internetware ’25, Trondheim, Norway, 20–22 June 2025. [Google Scholar] [CrossRef] [Scilit]
  9. Delligatti, L. SysML Distilled: A Brief Guide to the Systems Modeling Language; Addison-Wesley: Reading, MA, USA, 2014. [Google Scholar]
  10. Aamodt, A.; Plaza, E. Case-Based Reasoning: Foundational Issues, Methodological Variations and System Approaches. Eur. J. Artif. Intell. 1994, 7, 39–59. [Google Scholar] [CrossRef] [Scilit]
  11. Alanazi, M.N. Basic Rules to Build Correct UML Diagrams. In Proceedings of the 2009 International Conference on New Trends in Information and Service Science (NISS), Beijing, China, 2009, 30 June–2 July 2009; pp. 72–76. [Google Scholar] [CrossRef] [Scilit]
  12. El-Attar, M.; Miller, J. Producing Robust Use Case Diagrams via Reverse Engineering of Use Case Descriptions. Softw. Syst. Model. 2008, 7, 67–83. [Google Scholar] [CrossRef] [Scilit]
  13. Alksasbeh, M.Z.; Alqaralleh, B.A.Y.; Alramadin, T.A.; Alemerien, K.A. An Automated Use Case Diagrams Generator from Natural Language Requirements. J. Theor. Appl. Inf. Technol. 2017, 95, 1182–1190. [Google Scholar]
  14. Dias, H.R.P.; Vidanapathirana, C.S.L.; Weerasinghe, R.; Manupiya, A.; Bandara, R.M.S.J.; Ranasinghe, Y.P.H.W. Automated Use Case Diagram Generator Using NLP and ML. arXiv 2023, arXiv:2306.06962. [Google Scholar]
  15. Sharma, V.; Biswas, K.K.; Nandi, S. Automatic Generation of UML Diagrams from Natural Language Specifications. In Proceedings of the ICACCI 2014, Delhi, India, 24–27 September 2014. [Google Scholar]
  16. El-Attar, M.; Miller, J. Matching Antipatterns to Improve the Quality of Use Case Models. In Proceedings of the RE’06, Minneapolis/St. Paul, MI, USA, 11–15 September 2006. [Google Scholar] [CrossRef] [Scilit]
  17. Bhatnager, A.; Gullapalli, L.B.; de Saqui-Sannes, P.; Vingerhoeds, R.A. Measuring the Complexity of SysML Models. Systems 2025, 13, 1128. [Google Scholar] [CrossRef] [Scilit]
  18. Schleifer, S.; Lungu, A.; Kruse, B.; van Putten, S.; Goetz, S.; Wartzack, S. Minimal Data, Maximal Impact: Language Model-based Pipelines for the Automatic Generation of Use Case Diagrams from Requirements. In Proceedings of the DfX2024, Bamberg, Germany, 12–13 September 2024. [Google Scholar]
  19. García Alarcia, R.M.; Golkar, A.; Salado, A. Exploring Similarity Assessments of LLM-generated Requirements. In Proceedings of the 23rd Annual Conference on Systems Engineering Research, Arlington, VA, USA, 6–9 April 2026; Available online: https://www.researchgate.net/publication/403661911_Exploring_Similarity_Assessments_of_LLM-generated_Requirements (accessed on 18 August 2026).
  20. Gomes, P. A Case-Based Approach to Software Design. Ph.D. Thesis, University of Coimbra, Coimbra, Portugal, 2004. Available online: https://estudogeral.sib.uc.pt/bitstream/10316/1765/2/Thesis_FinalPG.pdf (accessed on 10 September 2026).
  21. Bach, K.; Sauer, C.; Althoff, K.-D.; Roth-Berghofer, T. Knowledge Modeling with the Open Source Tool myCBR. In Proceedings of the 10th Workshop on Knowledge Engineering and Software Engineering, Prague, Czech Republic, 19 August 2014; Available online: https://ceur-ws.org/Vol-1289/kese10-09_submission_11.pdf (accessed on 10 September 2026).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.