Editorial note: I originally wrote this post for the NDepend blog. You can check out the original here, at their site. While you’re there, download NDepend and, well, get to know it.
I confess to a certain level of avoidance when it comes to tackling something new. If pressed for introspection, I think I do this because I can’t envision a direct path to success. Instead, I see where I am now, the eventual goal, and a big uncertain cloud of stuff in the middle. So I procrastinate by finding other things that need doing.
Sooner or later, however, I need to put this aside and get down to business. For me, this usually means breaking the problem into smaller problems, identifying manageable next actions, and tackling those. Once things become concrete, I can move methodically. (As an aside this is one of many reasons that I love test driven development — it forces this behavior.)
When dealing with a new product or utility that I have acquired, this generally means carving out a path toward some objective and then executing. For instance, “learn Ruby” as a goal would leave me floundering. But “use Ruby to build a service that extracts data via API X” would result in a series of smaller goals and actions. And I would learn via those goals.
For NDepend, I have a recommendation along these lines. Let’s use the tool to help you visualize your the reality of your codebase better than anyone around you. In doing this, you will get to know NDepend quickly and without feeling overwhelmed.
First things first. Before you can do much of anything with NDepend, you need to set it up to analyze your codebase. You can get here with a pretty simple sequence of steps.
- Download NDepend and unpack it.
- Run the Visual Studio Extension installer and install the extension for your preferred version.
- Launch Visual Studio and open the solution you want to visualize.
- Attach a new NDepend project to your solution, selecting the assemblies you’d like to analyze and then clicking “analyze” (leave the “build report” checkbox checked).
That’s all there is to getting started and running an analysis. I won’t go into more detail here, as NDepend has good online documentation and the nuts and bolts are beyond the scope of what I want to cover. But you’ll find it fairly easy to get going here on your own, and to get your code analyzed.