How many times you have spent hours on code just to understand what it does?
How many of these times it was your own code?
From my experience the answer to both of these questions is A LOT!
In Visual Studio 2010 we can find a set of tools that can help us understand the code a lot faster.
On This post I will show some of the abilities we get with the Visual Studio 2010 Architect Tools when investigating an existing code.
Note: The Architect Tools is in the Visual Studio Ultimate Edition only.
Lets start with ways to investigate an existing code, for that I will use a common solution called “TailSpinToys”.
Step 1: Go to the “Architect” menu item on the main menu
Step 2: Choose “Generate Dependency Graph”
Step 3: Choose “By Assembly”
What we get is an Assemblies graph that shows all the dependencies between the Assemblies in our solution and two more very important groups:
The thickness of the links shows how strong is the link between the assemblies.
Lets continue and play with it a little, I will extract the Generics group.
Its little hard to see but what we get is all the generics that we use in our solution
I will now extract the Externals group.
You can see here all the references that we use in the solution.

I will now extend the System.dll
You can now see all the workspaces in the System.dll, these are not all the workspaces that exist but only the workspaces that are used.
You can continue to dig in and see all the methods that are in the classes that are in the namespaces.
That is nice, but what if I like to be more specific in my Graph creation?
The answer to this need comes from the Architecture Explorer:
Here you can choose what to investigate and set the scope for the graph.
In my example I have done the following steps:
Step 1: Choose “Solution View”
Step 2: Click the filter to see only the “Projects”

You can see that the view is filtered by a Filter Icon.
Step 5: Choose the Projects that are shown in the screenshot
Step 6: Click the “Files” bar and choose “References”
By choosing References you will see only the reference files
Step 7: Filter by Project
Step 8: Choose all and click the Generate a Graph button on the left

There are many more options in the architect tools that I will cover in future posts.
Have Fun!!!