<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://interactiveasp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Nates Stuff : Product Reviews, .NET</title><link>http://interactiveasp.net/blogs/natesstuff/archive/tags/Product+Reviews/.NET/default.aspx</link><description>Tags: Product Reviews, .NET</description><dc:language>en</dc:language><generator>CommunityServer 2008 (Build: 30417.1769)</generator><item><title>Visual NDepend Blows My Socks Off!</title><link>http://interactiveasp.net/blogs/natesstuff/archive/2009/02/26/visual-ndepend-blows-my-socks-off.aspx</link><pubDate>Fri, 27 Feb 2009 00:10:23 GMT</pubDate><guid isPermaLink="false">b80005ef-4071-4968-b08e-765d7d71b33e:515</guid><dc:creator>Nathan Zaugg</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://interactiveasp.net/blogs/natesstuff/rsscomments.aspx?PostID=515</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://interactiveasp.net/blogs/natesstuff/commentapi.aspx?PostID=515</wfw:comment><comments>http://interactiveasp.net/blogs/natesstuff/archive/2009/02/26/visual-ndepend-blows-my-socks-off.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/Splash_5F00_2B39B8DE.png" target="_blank"&gt;&lt;img title="Splash" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 5px 0px; border-right-width: 0px" height="94" alt="Splash" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/Splash_5F00_thumb_5F00_0A25FA9D.png" width="229" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I’m not easily impressed by even the best of software.&amp;#160; There is usually some little thing that ruins my user experience.&amp;#160; I tell you this so you know that what I say next is something special.&amp;#160; Visual NDepend is AWESOME!&amp;#160; Everything meet or far exceeded my expectations!&amp;#160; If you are not yet running this software, you should be!&amp;#160; This is not one of those ‘nice to have’ pieces of software like you might thing.&amp;#160; This is a must have!&amp;#160; If Microsoft was smart they would do everything they could to package this in with Visual Studio 2010.&amp;#160; &lt;/p&gt;  &lt;p&gt;What does it do? It’s hard to answer that question in a paragraph or two.&amp;#160; The basic answer is that it gives you a set of different representations of your software in such a way that you can understand the architecture and complexity.&amp;#160; This can be a huge help before undertaking large refactor efforts.&amp;#160; It also gives you an idea or the quality of the code based off of some metrics.&amp;#160; This quality score can be a really good indicator of wither your code is going to be maintainable and if it’s not it can help you get it there.&amp;#160; Before I go through the quick walkthrough of the software it’s self I’ll just say this – If you’re not paying attention to code metrics and the maintainability of the code from the earliest stages of development your likely not going to develop code that is easy to maintain.&amp;#160; And as you probably know, software maintenance is usually more than 3/4ths the cost of the software lifecycle.&amp;#160; Therefore, if you can get a build process established early and use a tool like NDepend to keep a close watch on some important metrics I can guarantee you will be creating much higher quality software than you would have otherwise.&lt;/p&gt;  &lt;h2&gt;Installation Experience&lt;/h2&gt;  &lt;p&gt;This is the best kind of install – you simply unzip the files.&amp;#160; I bet you didn’t think I would do a whole section on install when there is nothing to the install.&amp;#160; I suppose if it were any other product there would be a lot under this section.&amp;#160; &lt;/p&gt;  &lt;h2&gt;Analyze a Project&lt;/h2&gt;  &lt;p&gt;The user interface is very intuitive.&amp;#160; I installed integration with Visual Studio 2008 and .NET Reflector with minimal effort and started to analyze my assembly.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/Analyzing_5F00_3087DDE8.png" target="_blank"&gt;&lt;img title="Analyzing" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="115" alt="Analyzing" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/Analyzing_5F00_thumb_5F00_73EFDF4A.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/MainScreen_5F00_334D92DB.png" target="_blank"&gt;&lt;img title="Main Screen" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="442" alt="Main Screen" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/MainScreen_5F00_thumb_5F00_0E4FD262.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It took a while to analyze but this particular assembly is quite large!&amp;#160; It also pulls in any referenced assemblies so the graph can be complete.&amp;#160; It allows you to specify multiple assemblies just in case you have sets of assemblies in the same project that have no direct relationship.&amp;#160; In this case I had a WCF service that would need to be added separately as it’s technically not a direct dependency.&amp;#160; Once the analysis is complete it’s INFORMATION OVERLOAD!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/Analysis_5F00_4DAD85F2.png" target="_blank"&gt;&lt;img title="Analysis" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="440" alt="Analysis" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/Analysis_5F00_thumb_5F00_7819B70F.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;Results&lt;/h2&gt;  &lt;p&gt;There are six or seven main results to view.&amp;#160; The most obvious is the bubble chart at the top.&amp;#160; This gives you a visual representation of different aspects of the code.&amp;#160; For example it’s currently set to Method level and the metric shown is number of lines of code.&amp;#160; the larger the bubble, the larger the method is in relation to the others.&amp;#160; I can select from Method, Field, Type, Namespace or Assembly.&amp;#160; In addition there are 11 different metrics that you can plot in the bubble chart.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/BubbleChart_5F00_73370353.png" target="_blank"&gt;&lt;img title="Bubble Chart" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="298" alt="Bubble Chart" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/BubbleChart_5F00_thumb_5F00_51D75DB7.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The next thing you notice is the dependency graph.&amp;#160; Unfortunately this project doesn’t have a dependency graph like in my other &lt;a title="Avoiding Circular Dependencies" href="http://interactiveasp.net/blogs/natesstuff/archive/2008/06/09/avoiding-circular-dependencies.aspx" target="_blank"&gt;blog post&lt;/a&gt;.&amp;#160; Visual Studio makes it really tough to make circular dependencies but it is possible to create them if not all of your projects are loaded into the same solution.&amp;#160; And as I said in the other post, circular dependencies are very bad!&amp;#160; It’s also good to know what references what.&amp;#160; You might be surprised to see what kind of references get worked in over time.&amp;#160; On a recent project the data layer code kept working it’s way up to the UI even though it didn’t belong there.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/DependencyGraph_5F00_711A048A.png" target="_blank"&gt;&lt;img title="Dependency Graph" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="613" alt="Dependency Graph" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/DependencyGraph_5F00_thumb_5F00_1B8635A8.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The next section is the code metric-centric part. This is my most favorite portion of the results generated and can be a real good indicator of how maintainable a codebase is.&amp;#160; Of course it’s impossible to avoid all complexities in software so you probably can’t have a perfect score with every project but you can use this information to figure out what kinds of habits you have that contribute to un-maintainable code. As you can see from the image below when you select a metric it is highlighted in the bubble chart.&amp;#160; In fact, all of these reports are “active” so anything that is relevant to another will be indicated.&amp;#160; By the way, this application has amazing performance.&amp;#160; I’m pretty sure it’s using WPF under the hood.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/CodeMetrics_5F00_08D13BF1.png" target="_blank"&gt;&lt;img title="Code Metrics" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="308" alt="Code Metrics" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/CodeMetrics_5F00_thumb_5F00_59331D64.png" width="504" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/MethodsTooBig_5F00_383FAABD.png" target="_blank"&gt;&lt;img title="Methods Too Big" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="298" alt="Methods Too Big" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/MethodsTooBig_5F00_thumb_5F00_57161E9B.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Another really cool feature is the Dependency Matrix.&amp;#160; This takes some practice to use but it helps identify which pieces of which assemblies access pieces of other assemblies.&amp;#160; Again, great for refactoring efforts and a good indication of how an application is put together.&amp;#160; You may have to stair at the image below for a while to figure out what it’s trying to tell you but after a while it makes perfect sense.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/DependencyMatrix_5F00_6F3988F6.png" target="_blank"&gt;&lt;img title="Dependency Matrix" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="192" alt="Dependency Matrix" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/DependencyMatrix_5F00_thumb_5F00_0352A580.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Last, but certainly not least is the comprehensive report compiled into HTML.&amp;#160; This is the kind of thing that I’d love to see emailed to me each day, so I hope it’s easy to put this into a build process.&amp;#160; The report is awesome!&amp;#160; My favorite part of the software and I really like this software.&amp;#160; Below is the screen shot of the table of contents that is generated at the top.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/AnalysisReport_5F00_6D88BD22.png" target="_blank"&gt;&lt;img title="Analysis Report" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="404" alt="Analysis Report" src="http://interactiveasp.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/natesstuff/AnalysisReport_5F00_thumb_5F00_1A9DA9F1.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The only feature I didn’t get a chance to try is code coverage results.&amp;#160; I would have loved to see that in action!&amp;#160; Too bad I don’t have a project with very good code coverage results and I’d be embarrassed to find out anything in detail about my code coverage.&amp;#160; Of course &lt;a href="http://interactiveasp.net/blogs/natesstuff/archive/2008/04/23/unit-testing-philosophy-code-coverage-is-meaningless.aspx" target="_blank"&gt;code coverage isn’t everything&lt;/a&gt; but it is a useful tool when taken into context and can be made more useful with nDepend.&lt;/p&gt;  &lt;p&gt;Overall, I would give this software very high marks!&amp;#160; I can’t wait to make this part of my build process!&amp;#160; It is worth the time and money!&lt;/p&gt;  &lt;h5&gt;Links:&lt;/h5&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="http://www.ndepend.com/" href="http://www.ndepend.com/"&gt;http://www.ndepend.com/&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://interactiveasp.net/blogs/natesstuff/archive/2008/04/23/unit-testing-philosophy-code-coverage-is-meaningless.aspx" href="http://interactiveasp.net/blogs/natesstuff/archive/2008/04/23/unit-testing-philosophy-code-coverage-is-meaningless.aspx"&gt;http://interactiveasp.net/blogs/natesstuff/archive/2008/04/23/unit-testing-philosophy-code-coverage-is-meaningless.aspx&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://interactiveasp.net/blogs/natesstuff/archive/2008/06/09/avoiding-circular-dependencies.aspx" href="http://interactiveasp.net/blogs/natesstuff/archive/2008/06/09/avoiding-circular-dependencies.aspx"&gt;http://interactiveasp.net/blogs/natesstuff/archive/2008/06/09/avoiding-circular-dependencies.aspx&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://interactiveasp.net/aggbug.aspx?PostID=515" width="1" height="1"&gt;</description><category domain="http://interactiveasp.net/blogs/natesstuff/archive/tags/Tools/default.aspx">Tools</category><category domain="http://interactiveasp.net/blogs/natesstuff/archive/tags/Testing/default.aspx">Testing</category><category domain="http://interactiveasp.net/blogs/natesstuff/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://interactiveasp.net/blogs/natesstuff/archive/tags/.NET/default.aspx">.NET</category><category domain="http://interactiveasp.net/blogs/natesstuff/archive/tags/Product+Reviews/default.aspx">Product Reviews</category></item></channel></rss>