Large codebases (in the order of millions to 10s of millions of lines of code) are notoriously difﬁcult to understand, modify and maintain. They are the product of hundreds of developers
working simultaneously over several decades and are often poorly documented. For new developers, building up a workable mental model of these systems can take a considerable
amount of time.
Software visualisation is one area that seems ideally suited to address this problem, but that in practice, does not see much use beyond high-level, hand-crafted architecture diagrams and node-link diagrams that typically scale poorly to larger systems.
We are developing a scalable, spatial visualisation for large codebases based on a world-map metaphor. The core of the idea is mapping the continent/country/state/city/etc. hierarchy to the
equivalent in a code base – the high-level architectural components down to the individual ﬁles and functions that comprise them – and laying these out so as to maintain the intuitive notion that the proximity of any two entities is proportional to their coupling.
Our approach takes as input a dependency graph of the system and, optionally, a predeﬁned abstraction hierarchy to group the low-level source code entities into their higher-level system components. If a hierarchy is not supplied, we recover one from the dependency graph using a graph clustering algorithm. From there we use a combination of force-directed graph layout,
implicit surface generation, and Voronoi treemaps to produce a map of the codebase.
Our approach allows users to browse the system at any level of detail using the familiar pan/zoom interaction model of web-based mapping services. It provides strong visual landmarks for faster navigation thanks to the distinctive shapes and positions of regions on the map, and lends itself to easy data overlay – the size and colour of regions are proportional to supplied code metrics, while bug locations, search results, and dependency edges can be superimposed.
A formal evaluation of the prototype has not yet been undertaken, but initial feedback from internal development organisations has been very positive, particularly for the data overlay capabilities and intuitive zoom-for-detail interaction model.