If you’ve ever written much code you’re probably familiar with holding mental models of a program in your head. Since our heads are somewhat limited you’ve probably also used some sort of aid to help remember, think and communicate about that model. This could be simple and low tech like scribbling down boxes and arrows on a whiteboard or complicated like UML and Visio.
But what if you don’t have the model, either in your head or on paper? What happens when you come to a new codebase where the experts who undertand it are unavailable? Or perhaps the codebase is yours but you’ve forgotten how it all works (this happens to me all the time :)?
One way to solve this problem is to try and extract the program model automatically and use some kind of visualization to help you regain (or gain) your mental model.
There are a few tools out there that do this for static languages like SolidSX for Java and C# which maps code relationships using a ring with lines connecting classes that depend on each other.
There is also a haskell example of visualizing the types from all the packages on Hackage.
Useful and great in a pinch but kinda boring and hard to get a sense of the relationships between objects.
More details on the design and rational can be found in the report if you’re interested.
You can also find all the code over at the github project page.