| 摘要: | 類別圖是軟體設計的重要工具,在初期設計階段用於描述系統中類別之間的 結構與關係,協助軟體工程師在程式開發階段清楚掌握程式整體架構。然而,類 別圖中的潛在設計問題可能在未經系統實際運行的情況下難以察覺,進而導致後 續開發困難、維護成本上升,並降低系統的可擴展性。此外,現有的自動化分析 工具多僅具備基本指標分析功能,缺乏提供具體改進建議的能力。為解決上述問 題,本研究聚焦於提升類別圖設計品質,特別針對繼承關係架構設計方面,建立 一個自動評估類別圖架構品質的系統,名為Class Diagram Analysis Assistant,簡 稱CDAA。CDAA系統結合YOLOv11(You Look Only Once)深度學習模型與檢 索增強生成(Retrieval-Augmented Generation, RAG)技術。具體而言,CDAA 透過 YOLOv11 進行物件檢測,從類別圖中自動提取結構元素,如類別、箭頭及繼承 線等,並藉由 RAG 技術檢索相關設計規範與研究知識,再透過大型語言模型 (Large Language Model, LLM)分析繼承架構的合理性,協助開發者快速發現並解 決潛在問題。在操作上,CDAA能以自然語言提問,並整合研究知識進行推理以 提供更全面的修改建議,協助使用者更有效率地發現類別圖中的設計缺陷,改善 現有方法檢測效率低與分析不精確的問題,進而降低維護成本,確保系統的長期 可維護性與穩定性。;Class diagrams are essential tools in software design, During the early design phase where they describe the structure and relationships between classes, assisting software engineers in comprehending the overall architecture prior to implementation. However, potential design flaws in class diagrams may be difficult to detect without executing the system, which can lead to development challenges, increased maintenance costs, and reduced system scalability. Moreover, most existing automated analysis tools focus only on basic metric evaluations and lack the capability to provide concrete modification suggestions. To address these issues, the study proposes a system named Class Diagram Analysis Assistant (CDAA), which aims to improve class diagram design quality, with a particular focus on evaluating inheritance structures. CDAA integrates the YOLOv11 (You Only Look Once) deep learning model with Retrieval-Augmented Generation (RAG) techniques. Specifically, YOLOv11 performs object detection to automatically extract structural elements from class diagrams, such as classes, arrows, and inheritance lines. RAG is then employed to retrieve relevant design guidelines and academic knowledge, which are further processed by a Large Language Model (LLM) to analyze the appropriateness of inheritance structures. CDAA allows users to interact through natural language queries and leverages integrated knowledge and reasoning to generate comprehensive design improvement suggestions. This approach enhances the precision and efficiency of class diagram analysis, helping users to identify and resolve design flaws more effectively. Ultimately, the system aims to reduce maintenance costs and ensure long-term maintainability and stability of software systems. |