Posts Tagged NDepend

NDepend Use Case – Find Childless Interfaces (TDD Helper)

When using TDD, especially with utilities such as StuctureMap’s RhinoAutoMocker I tend to end up with some “childless” interfaces.

Granted, this could just mean I’m a crappy OO designer, but I like to think it’s more from hammering out the design as I’m working on the problem!

So, I might have a code base that has unused interfaces lying around, and I just want to clean those up.

With NDepend, you can use Code Query Language (CQL) to search for items of interest in your code base. Very cool.

Here’s the CQL for finding Interfaces that have no implementations.

[csharp] // <Name>Find interfaces without Derivatives</Name> SELECT TYPES WHERE IsInterface AND NbChildren == 0 [/csharp]

Tags: , ,

NDepend – First Impressions

Sitting down to check out a copy of NDepend is very intimidating. You see, I’ve been intrigued by the product ever since reading Hanselman’s description of its capabilities. Scott also put up a cheat sheet of sorts to the metrics used in NDepend’s analysis.

Rather than a rehash, go check the article, another bang-up job by Scott. What is intimidating is all the analysis you can do with this tool, it makes you feel like you should be doing something smart with it.

For that problem, I can’t say I have a good solution for you. Perhaps if I was in charge of more than a handful of developers as a architect, and coded less frequently, this tool would feel more comforting to me. In my current capacity as a dev lead, working daily in .NET with a team of other senior dev’s, I haven’t quite entered that “Zone of Pain”.

One thing I give kudo’s to the NDepend team for is their Videos and Tutorials and comprehensive help. Clearly I’m not the only one some confusion on how to make the most of this tool and it’s great to know that the product team has put serious work into making the tool discoverable and useful.

Check out this Welcome Screen:

Notice the real estate devoted to “Getting Started”, a very nice touch.

Another nice feature, is an ability to call out NDepend from Visual Studio and Reflector, which is my normal code exploratory/analysis tool.

Tags: , ,