CodeXView: Leveraging LLMs for Automated Class Collaboration Diagram Generation
2025 (English) Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
This thesis introduces CodeXView a visualization tool designed to bridge the gap between raw source code and developers' mental picture by automatically generating Class Collaboration Diagrams using a Large Language Model. The CodeXView prototype has been developed as a Visual Studio Code extension in JavaScript to enable easy integration into workflows. CodeXView parses a codebase into an abstract syntax tree via Tree-sitter, then it's converted into PlantUML code through OpenAI's LLM-o1 reasoning model. This generates the Class Collaboration Diagrams that capture runtime class interactions.
To assess the effectiveness of Class Collaboration Diagrams, participants completed a survey involving analyzing two state machine codebases, one accompanied by a diagram and one without. We evaluated their responses to measure both the accuracy of their understanding and the analysis completion time. Although we expected the diagram to enhance comprehension and reduce analysis time, the results showed no significant improvement.
A separate evaluation was conducted to assess the accuracy of the LLM generated diagrams. By generating diagrams and subjecting them to a two-stage validation process: an automated structural check and a manual semantic review. The results showed that diagram accuracy could not be ensured and that the same was true for diagram accuracy over time.However, the tool can process seven programming languages in under 30 milliseconds per file, demonstrating robust cross-language applicability.
Although the current iteration falls short of practical use without humans' oversight, this work establishes a foundation for automated diagram generation using LLMs. It also identifies key areas for improvement, including prompt engineering, model fine-tuning, and exploration of alternative diagram types.
Place, publisher, year, edition, pages 2025. , p. 46
Keywords [en]
Class Collaboration Diagrams, Large Language Models, Code Architecture, Software Visualization
National Category
Software Engineering
Identifiers URN: urn:nbn:se:hj:diva-69229 OAI: oai:DiVA.org:hj-69229 DiVA, id: diva2:1980851
External cooperation
B3 Consulting Group Göteborg
Subject / course JTH, Computer Engineering
Presentation
2025-05-25, Jönköping, 13:30 (English)
Supervisors
Examiners
2025-07-282025-07-022025-10-13 Bibliographically approved