“Sourcetrail was built with the goal to save developers time when working on unfamiliar source code”
If you find yourself “swimming” in unfamiliar waters, you should know that Sourcetrail is here to help: its goal is to save developers time when working on unfamiliar source code. We talked with Eberhard Gräther, founder of Sourcetrail about his project and how it plans to make Java developers’ lives easier, we look under its hood and get a sneak peek into its future.
JAXenter: When a codebase grows, it becomes increasingly more complex to track every addition. How can developers speed up the process of familiarizing themselves with the codebase?
Eberhard Gräther: Working on a new codebase is in some way similar to moving to a new city. You don’t know the names of streets and good places to get some food at first, but as you spend more time in it, you start to get a grasp. For cities, this has become a lot easier with online navigation systems. You can just enter the name of some place and you will be directed there.
For a codebase, this wasn’t so easy so far. You had to ask other developers or look around until you ended up with your desired goal, somehow. Sourcetrail is like a navigation system for software developers. It analyses the whole codebase, knows all the places and shows you visually how everything connects.
JAXenter: What is the biggest disadvantage of code that has a high information density? How can developers differentiate between meaningless and meaningful details?
Working on a new codebase is in some way similar to moving to a new city.
Eberhard Gräther: Modern programming languages have a high information density, which means that you can express a lot of logic in just a few lines of code. If that adds up to a codebase with millions of lines of code, you can’t see the forest for all the trees anymore. Every line in the codebase is important, but if you look for something specific you need to read lots and lots of lines that you currently don’t care about.
So it is not only the content of each line that’s important but also how those lines are connected. Sourcetrail takes the structure of your codebase and uses visualization to present information in a way that is faster and easier to process for the human brain. That way you don’t need to read as many lines of code when looking for information and you get to the meaningful lines faster.
JAXenter: Do we need yet another code editor or should we just find a better way to dig through code?
Eberhard Gräther: There are already a lot of code editors and they do an excellent job of providing developers with efficient code writing features. However, since these editors and their user interface is mainly focused on the writing part, the source code navigation features are always secondary. This makes the task of reading and navigating source code harder than it should be.
Sourcetrail’s user interface is focused on source code navigation, so it’s very simple and intuitive to look at your codebase. For example, in code editors, the left click is used for setting the cursor, but since Sourcetrail doesn’t allow editing we can use that instead for activating the element under the mouse pointer. That way Sourcetrail feels more like a web browser, but for code.
JAXenter: What is Sourcetrail and how does it plan to make Java developers’ lives easier?
Eberhard Gräther: Sourcetrail is a developer tool for source code navigation and understanding. It was built with the goal to save developers time when working on unfamiliar source code. This is often the case when a new employee joins the team, or when a developer has to modify code that has been written by a coworker or already years ago.
In these cases, many hours are spent on getting to know the code, before being able to actually make changes to it. Most developers just see it as an unpleasant part of the job. We also faced these situations in our professional carrier, but we decided to look into it and come up with a better solution.
JAXenter: How does it work?
Sourcetrail feels more like a web browser, but for code.
Eberhard Gräther: Sourcetrail is an offline application that runs on your computer. It takes all your source files and retrieves information about which classes, methods, and variables exist and how they relate to each other. Then it allows you easily access all of this information via a fast search feature and a visual graph representation of your selected element.
But we also know that you cannot understand code without actually seeing it. So we also show a code window that lists all the places where the selected element appears in your code. This all adds up to a developer tool perfect for reading and understanding source code.
SEE ALSO: Microservices in Java: Yay or nay?
JAXenter: What’s new in the Sourcetrail 2018.1 release?
Eberhard Gräther: We are constantly collecting feedback from our current users e.g. about new features, existing issues, and unsupported use-cases. With our latest release, Sourcetrail 2018.1, we mainly focused including user feedback to improve existing features and fix known issues. We also improved the look of our user interface, to make sure everything looks and works the same on all our supported platforms: Windows, macOS, and Linux; A new major build is released every quarter.
JAXenter: What’s next for Sourcetrail?
Eberhard Gräther: With support for the programming languages C, C++ and Java, we can already back a big fraction of the software industry. But many more programming languages exist and we are constantly approached by developers of other languages with requests. So adding further language support is a big topic for us this year. We want to get to a place where Sourcetrail can support every software developer when reading and understanding code.