No longer updated: new and updated blog (including old content) at http://roy-t.nl

Archive for http://roy-t.nl, please update your bookmarks

Archive for August, 2009

Review: NDepend

Posted by Roy Triesscheijn on Monday 17 August, 2009

Just at the start of the summer vaction I got an e-mail from Patrick Smacchia, Lead Developer of NDepend he asked me if I was interested to write something about their wonderfull code analysis tool, as said called NDepend.

I warned Patrick that I’ve never used code analysis tools and that’s also the reason why this blogpost about NDepend is kind of brief, I can’t really compare it to anything else. However this is a good opertunity to check out where code analysis tools are at.

After receiving a product key I downloaded NDepend from their website which almost screams “MVP” and all the companies that use NDepend. (Altough I had never heard of it before Patrick e-mailed me). Big companies like Microsoft and NASA.  The website features quite a big documentation/tutorial section which are also accesible from within NDepend.

Reporting

After downloading and following the really easy video tutorials (I so love video tutorials) the power of NDepend becomes clear, it’s not just a simple tool that just shows a nice graph with dependencies. It’s much more, NDepend generates a very nice statistical analysis of your .Net code. When the statistic analysis is complete you can print a nice report and know all sorts of things about your code. Starting with a quick overview of your code.

Excerpt from my racing game:

Number of IL instructions: 1796
Number of lines of code: 294
Number of lines of comment: 152
Percentage comment: 34
Number of assemblies: 1
Number of classes: 6
Number of types: 8
Number of abstract classes: 0
Number of interfaces: 2
Number of value types: 0
Number of exception classes: 0
Number of attribute classes: 0
Number of delegate classes: 0
Number of enumerations classes: 0
Number of generic type definitions: 0
Number of generic method definitions: 0
Percentage of public types: 75%
Percentage of public methods: 85,15%
Percentage of classes with at least one public field: 12,5%

Number of IL instructions: 1796
Number of lines of code: 294
Number of lines of comment: 152
Percentage comment: 34
Number of assemblies: 1
Number of classes: 6
Number of types: 8
Number of abstract classes: 0
Number of interfaces: 2
Number of value types: 0
Number of exception classes: 0
Number of attribute classes: 0
Number of delegate classes: 0
Number of enumerations classes: 0
Number of generic type definitions: 0
Number of generic method definitions: 0
Percentage of public types: 75%
Percentage of public methods: 85,15%
Percentage of classes with at least one public field: 12,5%

As you can see allot of information, and this is just the top of the report.

Another very usefull metric in the report is the “Assemblies Abstractness vs. Instability” graph. Which will warn you if you are soldering everything togheter,  or a just creating useless interfaces instead of working code.  (Luckily my race game was pretty centered).

There are ofcourse allot more things, I could list them all here but it might be easier to just check this http://www.ndepend.com/Features.aspx#Metrics page.

Main screen

Let’s get to the main screen (sorry about the big image but there is just so much information there)
Main screenMain screen

The main screen visually lists all parts of your project, hovering over the ‘code’ blocks on the right gives you more information on the bottom left of the screen. You can change the way the code blocks on the right are ordered. Right now they are ordered by method with lines of codes, but you can select a variety of views. But you can also view them as types with #IL generated instructions or other things.

Code Query Language

NDepend also has a feature called ‘code query language’. This CQL allows you to select things that are of special interest to you, possibly all the methods that have more than 50 lines of code. You this in a simple SQL’esque language “SELECT METHODS WHERE NbLinesOfCode > 50”. There are also allot of predefined CQL statements that you can use ranging from method sizes to code quality and design.

Conclusion

As you can see NDepend has a lot to offer, and really I’ve just skimmed the surface here. I see a lot of potential for NDepend in large project groups especially for software engineers who need to worry about the code quality and robustness but who can’t check each and every line of code themselves. For small projects and ‘one man teams’ like me this tool is plainly overkill but fun to play with. Unfortunately I don’t have knowledge of other code analysis tools so I can’t really compare it to anything else. However NDepend feels solid and gives allot of usefull (documented) information.

Oh and did I mention it is a stand alone app aswell as an integration with Visual Studio? This pleases me very much as a VS Express user.

Special Thanks to Patrick Smacchia for providing a NDepend licence.

Posted in Blog, General Coding | Tagged: , , , , | 1 Comment »

Personal: CastleFest 2009

Posted by Roy Triesscheijn on Sunday 2 August, 2009

Organisational

As I’ve said in another blog post on my personal blog I’m going to merge my tech blog and personal blog because I hardly use my personal blog and would like to keep everything organized. So this will be my first non-tech related post here, jolly good isn’t it. I’ll mark these blog posts with “Personal” and will put them in the personal category so they can be easily filtered out for those people who read this blog for the tech stuff. ( I can totally imagine not everyone is that interested in everyone’s personal lifes, everyone is writing about everything these days, but well if find blogging a good way to relax a bit and somketimes you get those cheeky comments that it make it worth while).

CastleFest

Well now we’ve got all the bureaucratic crap settled let me tell you all about Castlefest. Castlefest is a small festival in Lisse, The Netherlands where for 5 years, like minded people meet.  The festivals main theme is ‘the medieval age’  but people can be seen wearing just about everything, from apropiate medieval pessant clothing to girls wearing commic-con like outfits. A pritty lass had a really cool Yuna (Final Fantasy) outfit.

However as I said the main theme is ‘the medieval age’ (hence Castle). Unfortunately my medieval costumes are ehm non-existent so I joined the “just wearing witty t-shirts” type of people with a t-shirt that praises leeks (the vegetable).

After some hours checking out all the little stores I was a bit disappointed. For women (and girls) there where the most beautiful dresses and outfits ranging from the year 1000 ‘cute’ peasant look to the 1800 victorian queen look to the  post apocalyptic scavanger girl look. Most of these outfits where hand made from leather and wool just stunningly beautiful.

For us man this was unfortunately quite different (okay I’ll ignore all the medieval weapons that where out there for now, a brave warrior has to wair clothes aswell you know).   There where some nice woolen cloaks that where affordable and there where some beautiful full leather outfits and brilliant napolean era costume but unfortunately these where quite expensive  (like €300,- for just the top expensive).  Normally priced shirts and pants where hard to come by.  (In the end I did get my hands on a cool thick-cotton shirt with leather ropes holding everything togheter but I really hoped that there would be some more man clothes in the affordable price range.)

Anyway later that day  the main reason why I came to castlefest revieled themselves: Valravn took the stage and they played like mad, for those who don’t know this band I really think you should check them out on youtube here.

(Quoted from last.fm) Eyes firmly on the 21st century, Valravn’s inspiration comes from the original Nordic music tradition. The band manages to organically blend the raw sounds from their ancient instruments with the smooth possibilities of electronic music. The fusion of the two yields a unique and powerful experience of the vigour and life, that lies hidden deep in the Nordic roots.

Valravn was really brilliant, looking at old youtube video’s it’s amazing to see how they’ve grown. The video I linked above is only a year old but damn the entire Valravn band seems pretty tame there while at castlefest they really rocked their harts out. They also played a few songs from their new cd which should be out soon(a friend of mine bought the cd right there but bol.com is still saying it hasn’t been released yet)! Brilliant and more energetic than their first album.

The day came to a closing by performing a heretic ritual togheter with the band Omnia, allot of my friends kept whining about Omnia being a bit arrogant and stuff (and I do agree) but their performance was memorable and it felt really as if people set them selves free during the ritual.

I had a great day at castlefest and I will surely go again next year, I might even put some more effort in dressing up and stuff. I can surely recommend these kind of festivals to everyone who enjoys a relaxed mood and doesn’t worry to much about people wearing funny clothes , the people at such festivals are just lovely.

I would’ve posted some photo’s but I didn’t bring my camera, I’ll see if my friend Mart has some pictures and if I can put them up here for a more general impression of what castlefest is.

Please let me hear your thoughts about this blog post and on mixing personal and ‘professional’ blog entries and how you’ve coped with this on your own blog(s).

Posted in Blog, Personal | Tagged: , , , , , , , | Leave a Comment »