It's not often that I come across a utility that impresses me so much that it literally blows my mind. Yes people, it's true, that today it happened to me... my mind was totally blown away by an idea so simple and yet so brilliant that it only took about 3 seconds to convince me that it is now the most important piece of my development environment. So much so that I see it as a complete game-changer, and it has me lamenting it's inability to be included in any of the other IDE's that I use.
I am talking about an amazing Visual Studio plugin called NCrunch. In the words of its developers:
"NCrunch is an automated parallel continuous testing tool for Visual Studio .NET. It intelligently takes responsibility for running automated tests so that you don't have to, and it gives you a huge amount of useful information about your tests (such as code coverage and performance metrics) inline in your IDE while you work.
Now, for those of you who are patient, and who didn't immediately follow the link I just gave you after reading the description, NCrunch is a product that actually lives up to, and even goes beyond it's hype. I downloaded and installed it today after hearing about it through another software engineer that I was interviewing, and within 10 minutes, I had already completed 3 relatively complex test scenarios, and all of the accompanying code (test first as I always do) without once running the test runner that comes with Resharper. Now don't get me wrong, I love
Resharper and it has a brilliant test runner and a whole passel of other features that have made it another must-have tool in my development swag, and yet it never really blew my mind like that first few hours working with NCrunch working it's silent magic in the background.
Ok, let me give you a quick overview of my working day today. After configuring NCrunch to deal with my product's more problematic dependencies, I started to write a test method for a new API module that I need to create. Within seconds of completing a simple test declaration, NCrunch was already telling me that my test was going to pass, and then told me it was going to fail as I added code to the test that I was about to provide an implementation for. Now, the way I write my tests involves linking a lot of simple single line methods to a BDD statement using the StoryQ BDD framework. As I add each method to my test class, I get it to throw a NotImplementedException, so that StoryQ will give me a report of all of the methods that I need to provide code for. As Each of these methods was being introduced to my test class, NCrunch was adding a bunch of coloured dots to my editor to indicate all of the code that indicated code which was going to cause my test to fail. As I started to replace the exceptions with implementation code, I'd see these dots go from red to green to indicate that my test methods were passing. I didn't even need to look at my test code again to know that the code being called was not only covered by a test, but that it was running successfully. And this was only the beginning!
As the day went by, I started to discover the many features provided by NCrunch which provides information about the state of the tests. While I wasn't really impressed with the NCrunch test runner popup window, it takes nothing from the fact that NCrunch provides a great deal of information live and yet unobtrusively to the developer, all via the little coloured dots it places in your IDE. I had control over everything from being able via a single mouse-click to set a breakpoint to stop on the first test failure in any given line of code, to finding instant exception and stack details relevant to any line of code linked to any given test failure.
Even with all of the really great bells and whistles, the truly mind blowing part was in how efficiently my time was able to be used throughout the day. think about it for a moment. At any given time, a programmer will write a couple of lines of code, and then execute his test runner to see if the code is going to do what the programmer wants it to do. At the same time, you'll probably add a paranoid save button click, and you'll wait for your solution to compile, the test to run, and then you'll go looking for your test to see if it passed or failed as expected. If you are really a paranoid Agile developer, you'll probably be running all of your tests every time you go to test your single code change, to be certain that your efforts have not broken something somewhere else. Of of these clicks and compiles, saves and what have you add up to time spent where your mind is only partly focused on the problem that you are solving. I'd estimate than in any given hour of coding time, the average programmer would have spent at least 15 minutes of time not actually coding, but waiting for tests to compile and execute. Today, I probably only executed the
Resharper test runner about 5 or 6 times. All of the rest of my time was spent actually writing the code, and seeing it fail and pass its tests in real time, AS I was coding!!! Seriously, I would have easily completed about 3-4 times more work as compared to any other normal day, and as a result all of my estimates are completely messed up for this weeks work, but talk about a massive efficiency and productivity boost, and all of this from a product that is still in beta!!
So the good news is that NCrunch is free to download and use at the moment. The thing that sucks the most however, is that I can't use it outside of Visual Studio, and that means I'm limited to using it only at work. At home I use Eclipse and MonoDevelop for various projects, and it only took me a couple of seconds to realise that I was going to seriously miss having access to NCrunch on my hobby projects.
So if it wasn't already clear from this article, I am seriously of the opinion that you can't be serious about developing apps in Visual Studio if you aren't using NCrunch, and if you've seen NCrunch and not been convinced that you absolutely must be using it all of the time, then you probably need to get yourself a CAT-scan!! I would also be very surprised if some NCrunch-like tools don't make their way into Eclipse and other big IDEs sometime soon after more developers become aware of how brilliant this IDE Plugin really is. Oh, and sorry if this whole article ends up coming across like some sort of cheezy corporate advertise-blog... I'm still seriously geeking-out over the whole thing, and actually looking forward to going in to work again tomorrow! ;-)
Please one more post about that.I wonder how you got so good. This is really a fascinating blog, lots of stuff that I can get into. One thing I just want to say is that your Blog is so perfect
ReplyDeletewater coolers
Thank you for your kind comment, and I hope you continue to enjoy the articles that I post here. :-)
ReplyDelete