Skip to main content

WD40...

As with many things the smallest impediment to something that requires you to go out of the way to do something can seem like Mt. Everest. Often categorised or named "Friction" you usually need something to help remove this "Friction" and smooth the way.

I'd like to introduce you to two utilities that rate as good as WD40 in helping remove said "Friction" (you knew I'd get there in the end!).

Enter stage left, NCoverExplorer. If you do professional Microsoft .NET development you must be aware of the whole raft of tools out there to help you improve the quality of your code. NCover is one of them but code coverage in a lot of peoples opinion falls slightly down the rankings in terms of importance compared to unit testing, continuous integration etc (I have revised my opinion of it and actually think it should be the first thing to implement in a project now, more on this later).

So lets cut to the chase (did you know that term originated from the game 'Real Tennis' where the chase is a line on the court and cutting the ball as close to it as possible is a good thing - I'm indebted to an ex-collegue of mine Russell Lloyd for that titbit!)...I've just refreshed my installs of TestDriven.NET, MbUnit, NCover and finally NCoverExplorer.

Now I have code coverage thats so friction-less you could go curling on it!

Right click your unit test project/class/unit test method inside VS.NET IDE and select "Test with...Coverage" - bam! Up springs NCoverExplorer to give you a quick treeview drill down of where you are (not) exercising your code - and if the entry point is your unit test class you can use it to drill down into the actual assemblies they are testing to see just what is being run and what isn't (unused, redundant code maybe?). I was never a real user of code coverage until now - now I'm glued to the NCoverExplorer window watching my coverage figures improve! As I mentioned earlier I now believe that (as with Test Driven Development) code coverage is an "up front" activity - get it in place before you write any code and use it in parallel as you develop to identify gaps between tests and code (they will exist!).


The other application you need to be aware of is Simian - it detects duplicate code. However the real magic is a shim that HvR wrote to make it truely usable - MonkeyWrangler! Follow the "last post" link to get the full instructions on how to integrate Simian with the VS.NET IDE. If you work on a project with multiple developers (as many of you will undoubtably do) this util will be a life saver for you. Run it on the project you are on right now - you will be quite amazed how much duplication you could have (put it down to Friday afternoon coding!).


I know the authors of these utilities, Grant ("kiwidude") and Howard personally. I worked with Grant on a long term project in London a few years ago and we've been friends since. As he commented to me the other day I allow him to live out is alter-gadget infested life without have to buy any of them! Grant, happy to be your gadget test pilot anyday! I know that when Grant calls it a day over here, cashes in and goes back to New Zealand his AV/gadget setup will be mind blowing and it will be a happy day to sit in the middle of it all and share a beer with him!

Howard is another ex-colleague from my Conchango days. This guy is quite simply dynamite!


I get to hang out with all the cool guys!...LOL

A useful tip also; regularly visit the websites/blogs of the everyday tools you use to augment your development and check for updates. There is often new releases and bug fixes and sometimes new features which can be real time savers.

Another tip: If something seems difficult or too much trouble then someone else has probably come across the problem also. If you are lucky its someone like Howard or Grant and they've fixed the problem for you! If you think there must be a "better way" to do something there probably is - Google for it, you are more than likely to find a solution. For the brave get yourself a group on Project Distributor (this is mine), write some code and publish it!

Comments

Popular posts from this blog

Walk-Thru: Using Wolfpack to automatically deploy and smoke test your system

First, some history... The advent of NuGet has revolutionised many many aspects of the .Net ecosystem; MyGet, Chocolatey & OctopusDeploy to name a few solutions building upon its success bring even more features to the table. I also spotted that NuGet could solve a problem I was having with my OSS System Monitoring software Wolfpack ; essentially this is a core application framework that uses plugins for extension ( Wolfpack Contrib ) but how to unify, standardise and streamline how these plugins are made available? NuGet to the rescue again - I wrapped the NuGet infrastructure (I deem NuGet to be so ubiquitous and stable that is has transcended into the software "infrastrucuture" hall of fame) with a new OSS project called Sidewinder . Sidewinder allows me to wrap all my little extension and plugins in NuGet packages and deploy them directly from the Wolfpack application - it even allows me to issue a new version of Wolfpack and have Wolfpack update itself, sweet huh

Configuration in .Net 2.0

11-Dec-2007 Update I've updated this post to fix the broken images and replaced them with inline text for the example xml and accompanying C# code. This post has been by far the most hit on this blog and along with the comments about the missing images I thought it was time to update it! Whilst recreating the examples below I zipped up the working source code and xml file and loaded this onto my Project Distributor site - please download it to get a full working custom configuration to play with! Just click on the CustomConfigExampleSource link on the right hand side, then the "Source" link to get the zip. We are in the process of converting our codebase to .Net 2.0. We've used Enterprise Library to great effect so decided that we should continue with this in the form of the Jan 2006 release which targets 2.0 and I've got the job of porting our Logging, Data Access etc wrappers to EntLib 2.0. ...And so far so good - the EntLib docs aren't bad and the migrati

Castle/Windsor schema enables Visual Studio intellisense

There has been a lot of noise recently about Inversion of Control (IoC) with .Net recently (stop sniggering at the back java guys!).... I've been using IoC via the Spring.NET framework for over 2 years now - it's a completely different approach to coding and once you get your head around it everything just falls into place and development is a real joy again. As I mention, Spring.NET is my framework of choice but a recent change in employer has seen me bump up against Castle/Windsor . First impressions are that I like it - it's not as powerful or feature rich as Spring but that's not always a bad thing! The one thing I did miss though was Visual Studio intellisense when editing the configurations - Spring has an online schema that can be associated with a Spring configuration. This got me thinking - if the VS intellisense can be hooked into that easily why not create one for Windsor configuration? So I did...you can download it from my new google code site here . Remem