Monday 6 February 2012

NDepend – final thoughts

Over the last 4 posts I’ve covered the different editions of NDepend, installing and starting off, the report and Visual NDepend and wanted to just wrap up this series summarising the information and adding some of my own thoughts.

The Product

I have to say that the fact NDepend offers a free version for individual developers is brilliant, there used to be several tools in the .Net world that did this but gradually they all seem to have become commercial and only offer time limited trial versions. 

There is a small catch in that the version you download is time limited itself but there is nothing to stop you downloading the another trial edition (web page even tells you when the next free download will be available) but I can imagine this becoming a pain after a while and could lead people to looking for an alternative.

One thing that surprised me was the amount of help and documentation that is available on the NDepend website ranging from simple FAQ’s to video tutorials which will help with not only how to use NDepend but the information the NDepend provides.

The Functionality

As I mentioned in my post on the report when you first start using NDepend you are most likely to focus on the data in the report and although it contains a lot of information I still believe that the report is of most benefit in a CI situation allowing you to track the evolution of your code base.

In day to day work Visual NDepend or the visual studio AddIn is where I believe the most value is to be found for individual developers allowing them to identify the points to focus on.

Although you can use the stand alone application (Visual NDepend) in my opinion for most developers it is the visual studio integration that will provide the most value since you don’t have to leave the IDE to utilise the functionality.

The Code Query Language is what differentiates NDepend from other static analysis tools allowing you to understand how it identifies code that violates its rules as well as making it easy to customize existing or create new rules.

Configuration/Customization

The fact that NDepend provides a way for you to customise the rules that it runs against a code based is, I believe, one of its biggest strengths. You also get fair amount of configuration over how it behaves and looks.

However, there is no easy way to share this customization/configuration between projects let alone other members of the team.  For me this is probably the biggest failing of NDepend, yes you can manually alter each project and using source control if you add the ndproj file then when the next developer pulls/gets the code they will get the settings.

A couple of issues…

One issue is that you need to care about what NDepend is showing you about your code base. There is a lot of information it provides and with the amount of help on the website it is fairly easy to understand the various metrics that NDepend rules identify and use.  Even with all this information you have to care about it, for example if you have methods with a high Cyclomatic Complexity although you may understand what it means if you don’t care then the the tool is of little use.

I feel I have to mention cost, for a larger enterprise organisation the licencing cost is unlikely to be a big issue but for smaller companies & individual developers, or hobbyists, the cost of the professional edition could be just too high. 

I would also mention that I believe if you want the best results from NDepend you need everybody on your team to have it as just having it on a single machine, even if its the build machine, makes it hard to then follow up and fix violations.

Summary

As anybody who knows me will know I’m a big fan of SOLID clean code and I like to be able to use metrics to understand my code and where I may need to improve it, I find that NDepend helps me with this.

It is simple to get started with but there in lies its deceptive nature as it can not only tell you a lot about your code base but you can also learn more about various principles behind good code bases (I learnt all about the efferent & afferent coupling).

NDepend is a tool that you need to spend time with to understand what it can show you and how to get the most out of it, if you do decide to invest the time I believe it will repay you in cleaner code and increased knowledge.

Note: I was provided a copy of the professional edition to review back at the beginning of last year, this hasn’t effected what I have said about the product which hopefully you can see in this series of posts.

Friday 3 February 2012

NDepend–Visual NDepend

The last post went over the report that NDepend generates, this post is going to focus on Visual NDepend, the stand alone program and the functionality it supports.

Interactive

The difference between the report and Visual NDepend (from now on I’ll just call it NDepend) is that you have much greater ability to drill down into the code base allowing you to jump between various graphs/diagrams, you can then right click on the item and jump to a different view with the specific item the focus of the graph/matrix.

Wednesday 1 February 2012

NDepend – Analysis Report

In my last post I discussed installing NDepend and getting your first report out, this post is about that report.

I’m not intending to go into every single aspect of the report as it contains a huge amount of information and the report itself provides help and assistance on nearly everything that it contains by linking to resources on the NDepend website.

Note: All details discussed are in relation to the Professional edition of NDepend, it is possible you will not see all this functionality if you are only using the trial edition

The Report

As I mentioned at the end of the last post with the Visual Studio AddIn in place when you build your application NDepend will automatically kick in, analyse the code and create a report for you detailing metrics, adherence to some standard developer rules, graphs displaying further information about the code base in different formats, etc.  Your browser will be launched and the html based report will be displayed but this isn’t a simple static report as it provides the ability to drill down into various sections to look at the analysis data in more detail.