With today’s IDEs, we are all forced to browse code by looking at flat-file structures, with almost no information about the semantic dependencies between them. What if we could take a look at our code from above – and instead of seeing just text files – go through colorful graph nodes that instantly and clearly show you dependencies and other important bits extracted from your codebase? We talked with Krzysztof Borowski about Graph Buddy – an innovative VL’s solution that actually lets you do that! With Krzysztof, the main contributor to this solution, we explored the history of Graph Buddy – from an idea, through work on the concept, to a ready extension.
It all started 1.5 years ago in London. During visiting our client, a need arose to divide the application into smaller parts. Krzysztof, together with his colleagues, came up with the idea that they could show connections between packages in code. Later, these connections were drawn and represented at the meeting. On the graph, one could clearly see potential areas for extractions as also problematic, tightly coupled common parts of the project. Such analysis allowed us to make a concrete plan and estimate the time needed for the separation. Krzysztof was already studying graphs during his studies, so he had knowledge in this field. All this contributed to the PoC (Proof of Concept) submission to the R&D space at VirtusLab, which helps to develop innovative ideas inside our company. After receiving the green light for the project, Krzysztof decided to also work on it as a part of his Ph.D. The academic support made Graph Buddy firmly located between technology and science.
The first version of Graph Buddy
Thanks to the simple framework of R&D processes at VirtusLab, Krzysztof received 2 paid weeks to develop his project during normal working hours. After some time, more people were hired to specifically join the Graph Buddy project. Currently, Filip Łukasik, Jakub Bania, and Mateusz Strąg are working with frontend and Krzysztof with backend.
The main technologies in the project are Scala, Neo4j (graph database), TypeScript, React, and vis.js (a library that helps in visualizations). Graph Buddy acts as a visual graph. It is based on the Language Server Protocol (see more) which makes it as easy to use & develop as possible. We have just submitted the graph-related operations as the official LSP standard.
Graph Buddy now
The problem the team is working on is very complicated, as transferring programming language statements to the graph is not trivial. You have to consider a lot of things, and write a graph generation mechanism for each language separately, which is the most time-consuming. The team would like to make this visual part the same for every language, so some common standards need to be set. A graph can have a thousand vertices even in a medium-sized project so Graph Buddy must be well-optimized to make everything run smoothly. As for plans, the team wants to do a statistic code analysis as an addition to the visualization (to show it directly in the code). Also, they are working on fetching data from the runtime and augmenting the graph using production data. VirtusLab plans to make Graph Buddy a comprehensive product. Here is another value of projects developed in our R&D – the employee, in addition to developing his innovative idea may in the future additionally be rewarded if the product will be successful on the market.
VirtusLab presented Graph Buddy and Context Buddy (you can read more about this solution in our other post) during last year’s edition of Sphere.it. Currently, these are separate projects, but they solve similar problems. Graph Buddy visualizes dependencies. Context Buddy provides a project history, both provide new valuable contexts for programmers. Context and Graph Buddies are parts of a bigger project (Visdom) that we are developing within VirtusLab to create a tooling ecosystem of the future.