CodeXView : Leveraging LLMs for Automated Class Collaboration Diagram Generation
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.
Institutions
- Department of Physics, Mathematics and Informatics (BY)
Publication Details
- Journal
- Jonkoping University Library (Jönköping University)
- Published
- 2025-01-01
- Primary Topic
- Data Visualization and Analytics
- Type
- article
- Field-Weighted Citation Impact
- 0.00