This is the second part of the NDepend vs. Alternatives feature. Some time has passed since the first comparison. Meanwhile I was working here and there with NDepend and like to share some of the impressions. The project I used for trying out NDepend in real life was a rather big one with more than ten sub projects. You can imagine, that it is difficult but also important to keep track of dependencies and what is going on.
Altavista
(aka: the projects vantage point)
As most of you I am a friend of class diagrams. They are very useful in getting the big picture. But while inheritance and members are shown they lack of dependencies between classes. For those who care about feature envy between classes this is not enough. NDepend visualizes this behavious in it’s structural diagram as well as in the treemap (there’s a simple metric for that, of course). This helps analyzing and refactoring classes.
Structural diagrams are also quite useful for documentation. They can be exportet with adjustable dpi making technical documentations more to the point than they are when simply using class diagrams.
I managed both issues using NDepend and was very satisfied with the ease of use and the result.
Metrics
Another issue NDepend addresses is to assist in writing better code. This is done by calculating an expandable set of rules. One can calculate simple things like lines of code in classes or more complicated stuff like cyclomatic complexity. The rules (or metrics) apply to different levels, from class level up to application level. NDepend features the “top scorers” in lists. Checking the metrics regularly therefore helps to find code smells.
NDepend is also capable of importing code coverage reports from coverage tools like NCover. Although this is a nice feature (displaying coverage in a treemap is really cool) it’s not at the heart of NDepend.
I used metrics calculation and visualization in treemaps regularly. The metrics supported a better code understanding.
Conclusion
I’m still fond of NDepend. Can’t help but like it. It’s commercial, ok, but give it a try (trial version available). And if you like it than it will probably be your company that buys it in the end.
