NDepend as an analysis tool
In these days I’m giving a look at NDepend. As a consultant I’m quite often called by software houses to review their code and try to improve the codebase.
The the very first thing that I usually do is to run a tool that analyze the codebase to found the critical points and to take a brief review of the project status.
NDepend is a great tool. In the past I used SourceMonitor but NDepend is much more complete and professional and give a lot more information about the code.
The first impression is a bit confusing, the UI is very complex and maybe show too much information for a newbie but if you analyze the single boxes you could see that all you need is in the right place and the UI became very intuitive and complete after few hours of use.
One of the feature that I love is the CQL queries, there are a lot of ready-to-use queries but you can also build your own.
The queries measure your code (for example they can extract the methods that have more than 50 lines of code or the types that are too coupled to another and so on…) and they are the indispensable tool to begin with the refactoring.
Another nice feature is that NDepend manages the different between two build. One of the important thing of a code metric is not only is absolute value but the variation during the life of the project. Here NDepend came in help with the Compare command that helps in finding the differences between two build of the same application. This metrics gives you the information about the wellness of your refactoring: if the metrics becomes better your work was good, otherwise you can always revert your changes.
Another option to use NDepend is to integrate the tool with CruiseControl.NET like exposed here (http://confluence.public.thoughtworks.org/display/CCNET/Using+CruiseControl.NET+with+NDepend).
This gives you the ability to continually run NDepend over the builds and have immediate feedback about the code status. I’m working on this and I will write another post about the use of NDepend in a CI environment.
All the information about NDepend is available here: www.ndepend.com and on the author’s blog you can read a lot of articles about the metrics and the use of NDepend(http://codebetter.com/blogs/patricksmacchia/default.aspx)
No comments
RSS


