Wednesday, February 06, 2008

Playing with NDepend

One of the first articles I wrote for my and James's book Windows Developer Power Tools was on NDepend.  I can't remember the exact version I covered, but it was right as Patrick was moving from his 1.x series to the 2.x version.

NDepend is a great metrics/code analysis tool.  It generates a wealth of metrics on your software, and it's fairly easy to use.  Scott Hanselman has a podcast on it which is well worth listening to, but in the meantime, here are a few of the high points about the tool.  (And I wrote about it before Hanselman, so neener neener.)

First off, love the startup screen: you can install plugins for Visual Studio and Reflector.  Wooo!

 

Secondly, after you run an analysis pass (select the assemblies you want, fire it off), you get a neat grid giving you a breakdown on dependencies in your code.

There's also an interesting graphical display for quickly visualizing potential problems in your code.  This view shows Lines of Code per type.

Clicking on one of the areas shows you specifics for that item.

All the above happen within the NDepend UI.  There's also a separate HTML report generated which gives you a metric crapload of detailed specifics on afferent and efferent coupling, complexity, stability, and other items. 

Patrick's also come up with a great query language to let you pull up potentially troublesome areas which a stock metric might not identify.  This one shows types with high cohesion and a large number of methods and fields.  Each section has a link to the NDepend site where you'll find more descriptive text.

NDepend was great in earlier versions; this newest version has a bunch of great features to offer.  It's a commercial tool, with licenses starting at around $400 and dropping as you buy more copies.  (A free license for Academic/Open Source projects is available.) This isn't a tool everyone on your team needs, but will be of great benefit to your tech leads or software architects.  It's a great tool and it's come a long, LONG way since the 1.x version I played with!

Disclaimer:  First off, I got a copy of this free as an MVP.  Secondly, Patrick's given out a copy for my .NET group to raffle off.  Neither of those mean I've been bought off for this glowing review.  Besides, the MVP license is only for "personal" use, so while I pointed NDepend at a project from work to play with, I won't be able to use it on a daily basis.

1 comment:

  1. LOL, "metric crapload" I love it. Nice post, very informative.

    ReplyDelete