Powerd by dasBlog RSS 2.0
 Tuesday, January 01, 2008

Today's task, a somewhat detailed code analysis of one of our Windows CE projects. In addition to reviewing from a lead architect point of view (design and implementation), I also needed to take a look at general coding practices. For this I turned to the Code Analysis tool in Visual Studio, and NDepend.

I had remembered reading about NDepend on Scott's blog, and went back there to re-read his post. I highly recommend it, as it's a great quick start and introduction to NDepend. Scott also has a pod cast available, and the the NDepend web site has links to several video tutorials showing how to use it.

One thing I found lacking, was there were no support forums on the NDepend web site. I had a couple of issues getting my Compact Framework application to be property recognized by NDepend. The main issue, was NDepend was trying to use the full framework version of System.Data instead of the Compact Framework version. I noticed that there was an option when selecting assemblies to resolved missing ones (well, some it let me, others it didn't), and figured the resolved location was stored in the project configuration file. So I opened it up in note pad and sure enough, there were all the directory paths.

I removed all of the paths that were added by default, and added my own paths to my project. I also added paths to the SQL CE 3.5 directory, as well as the location of the compact framework dlls (See update below). Unfortunately I still had issues with NDpend detecting multiple dlls (System.Data and System.Windows.Forms) with the same name. I decided to remove the path statements for everything except my project. This resulted in warning about not being able to resolve dependencies, but the analysis completed.

There is allot of information presented, almost to the point of information overload. I highly recommend printing out and reviewing the NDepend placemat as a quick reference. I concentrated primarily on the metrics, which use NDepend's Code Query Language to identify possible problems. I found myself viewing all of the queries to figure out what they were looking at. The documentation of the queries is excellent, and each one includes a link to the NDepend web site which defines the metric is pretty good detail.

I am quite impressed with the amount of information that NDepend gave me about my project. There were/are a few usability issues, but they can be overcome. I hope that I can continue to find time to make use of this excellent tool. I spent some time watching the video tutorials, and they were very helpful. I've been trying to get a side project started at home to try out all the tools, techniques, patterns, etc that I don't have time for at work, and this will definitely find it's way onto my to do list. I think it will be very interesting to use this from the beginning and see how the different metrics change as I build out my project.

Update:

  • 1/2/2008 - After watching the videos, I discovered that when you are setting up your project in VisualNDepend, there is a screen that lest you add/remove directories in the application. This is much easier then editing the project file manually like I was initially doing.

Other Links:

Tuesday, January 01, 2008 6:01:14 PM UTC  #    Comments [0] - Trackback
Programming | Review For Future Projects | Tools
Comments are closed.
Archive
<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Adam Salvo
Sign In
Statistics
Total Posts: 146
This Year: 72
This Month: 3
This Week: 0
Comments: 8
Themes
All Content © 2008, Adam Salvo
DasBlog theme 'Business' created by Christoph De Baene (delarou)