Diagram of classes helps Assistant understand code base more abstractly

In Progress
👨‍🔧 Use cases

Experiment 1


As part of an attempt to overcome the threshold of understanding the context during refactoring, described in Pitfalls, we tried to create a class diagram for part of the code that we wanted to refactor, upload it in text form to ChatGPT and ask questions about improving architecture.


If we provide ChatGPT with an adequate prompt and information about the module architecture in an understandable formal form, then we can try to make it give recommendations for high-level refactoring - at the level of abstractions and links between different components.

Experiment 1 👎

PlantUML Text Encoding was chosen as a formal representation of the module architecture. The class diagram was generated using built-in Intellij IDEA tools and exported to the PlantUML service.


The text representation was uploaded into ChatGPT and it was tasked with analyzing, evaluating, and providing specific and direct ways to improve the architecture.

Despite the fact that ChatGPT correctly analyzed the text UML representation of the module structure and was able to describe its essence quite accurately, there were no impressive results in terms of proposed improvements. The model suggested reasonable but quite abstract things like "Improve performance" or "Implement DI" and nothing useful.

Perhaps this time there was too little context and it might be worth trying to add more information.