Sourcetrail – Cross-platform Source Explorer for C/C++ and Java

Sourcetrail – Cross-platform Source Explorer for C/C++ and Java


Hello My name is Eberhard Gräther and this is a
quick tour of Sourcetrail. Sourcetrail is a cross-platform
source explorer for C, C++ and Java. It’s made to help software engineers navigate and understand an existing code base. If you want to know more about why we build Sourcetrail, please have a look at our blog. Like me you might also have worked
on a big code base before and when doing that you constantly
have to read what’s already there. It turns out this is a bigger problem
in software engineering. Software developers spend more time on reading
source code than on writing new one. To better help developers on the reading
task we built Sourcetrail. After creating a project Sourcetrail
will first index all source files. That way it knows about all classes, functions and
types used within your code base. The indexing is done completely offline
and after it’s fully finished once, you will only need to refresh change files. Sourcetrail’s user interface consists
of three main components, the search bar, the graph visualization and the code view. Use the search bar to find any symbol
throughout the whole code base. It supports fuzzy matching so you just need to enter parts of the name or starting letters. I just activated the method TicTacToe::Run(). Now the graph view is showing us an overview of that symbol’s relationships to other symbols. Classes and types are in gray, methods and functions are in yellow, fields and variables are in blue. What I can easily see here now, is that the method Run is only called once by the function main(). Clicking on this call-edge will show me
where in the code view. I can also see the two fields of TicTacToe
are being accessed. Clicking on the edge shows me where. Classes can also be expanded to show
all of their members, or selected with a click to see all their
connections to other symbols. As you might already have noticed the position of symbols around the active symbol
tells something about the relationship. The active symbol depends on
symbols on the right. The ones on the left depend on the active symbol. On the top are base types, on the bottom are derived ones. The code view will always show you the
definition of the active symbol on top and all references within other files below. You can extend the scope of what is shown and you can select another
symbol by just clicking on it. You can also highlight local symbols that
are not shown within the graph. If these snippets are getting too narrow for you, you can also switch to single file mode and have one whole file visible at once. Then you can navigate by just clicking on
edges within the graph view. In case you were wondering how to integrate Sourcetrail into your development workflow, we provide plugins for communicating back and forth with your source editor or IDE. I’m currently connected to Sublime Text and with that I can just choose
the context menu action, or do a control-click and have that file
opened in my editor at that location. I can also go the other way and activate a
symbol directly from my editor. As you’ve seen now the combination of our three components is pretty powerful when exploring source code. You can quickly find any symbol and then keep exploring in the graph or in the code. Lastly I wanted to show you some extra features that can be handy sometimes. We usually only show one level
of dependency in the graph, but you can extend that to show the whole call graph leading to a certain function. You can still activate edges the same way
to see their location. The same goes for classes, where you can
see the whole inheritance chain. If you want to go back to previously active
symbols you can use the back-button or just choose one from the history drop-down. And if you want to remember a symbol for
later, you can create a bookmark, and then later reactivate it
from the bookmarks manager. That’s it from me. If you want to try
Sourcetrail yourself, please visit our webpage sourcetrail.com, go to our trial page and download the latest release. If you also want to analyze your own source code you will need a test license, which you
get by filling in this form. Thanks for watching! I hope you enjoyed
my tour of Sourcetrail.

2 thoughts on “Sourcetrail – Cross-platform Source Explorer for C/C++ and Java”

Leave a Reply

Your email address will not be published. Required fields are marked *