Products, the Universe and Everything

The Riverblade Developer's Blog

Beth demonstrating Visual Lint at the ACCU Conference 2008  Anna taking part in a discussion panel at the European Software Conference 2007 

Welcome to our developer's blog. We hope that this forum provides an insight into us, our products and how we develop them. Please feel free to write to us if you have anything to add to any of the posts here.

Current Entries | Archives |


Test Driven Development - I'm Sold
Thursday, November 23, 2006

Unit Testing - and Test Driven Development - are rapidly emerging as one of the most effective techniques to improve code quality and reduce defect counts. or a while now it has been clear to me that this was the way to go to improve the quality of code - whatever framework or language was being used.

Our add-in code is native C++, but most of the Windows related resources on the subject focus on testing of .NET languages - usually C#. NUnit is well established as the leading unit testing framework for .NET, and does its job well. Not only that, but it can be closely integrated into Visual Studio via the TestDriven.NET add-in.

In contrast, the frameworks available for native code testing (notably CPPUnit) are less visible, and messier to use - CPPUnit also seems to lack a good interactive test runner. Although none of this is insurmountable, given the current heavy push on migration to managed code by Microsoft adopting a native-only single language unit test framework seems to me to be a short sighted approach.

One alternative which has seemed plausible to me for some time was to take advantage of the fact that C++ (unique of the Visual Studio languages) can be compiled to either native or managed code, and write NUnit style unit tests in Managed C++ or C++/CLI. This is something I've not seen discussed in any detail on the web at all, and unfortunately we didn't have time to investigate until recently.

However, with the release of Visual Lint 1.5 out of the way I've now had a little time to look into this again. In doing so, I have realised that the NUnit installation already includes a sample Managed C++ project (it's called cpp-sample) which forms an ideal starting point from which to experiment in this area.

Having spent around a week doing so (using Kevin Lussier's CSplitPath class and some of our utility functions as simple test subjects) I can confidently say that not only is this a viable approach to unit testing native C++ projects, but that I'm now totally sold on the concept of Test Driven Development itself.

Here's one of our sample tests:


void SplitPathTests::GetDirectory(void)
{
CString sPathName = _T("C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include\\atlbase.h");

CSplitPath split(sPathName);

String* result(split.GetDirectory() );
String* expected(S"\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include\\");

Assert::AreEqual(expected, result);
}

Even in that small sample of test subjects, we discovered around half a dozen bugs - one of which was a serious buffer overflow in CSplitPath itself (clue: we build in Unicode, and it wasn't written that way).

In fact, I'm so convinced of the concept that we have now integrated a Unit Test project into Visual Lint itself - and one of our current tasks is being run as far as possible under TDD. In doing so, we're finding the books Unit Test Frameworks by Peter Hamill and Working Effectively with Legacy Code by Michael Feathers to be invaluable. Highly recommended.

Convinced? I certainly am.

Posted by Anna at 12:29 | Get Link

 

"We Apologise For The Inconvenience"
Wednesday, November 22, 2006

...so reads God's Final Message to His Creation - at least according to The Hitch-Hiker's Guide to the Galaxy.

When I stumbled out of bed at something like 6am this morning and blearily went to check my email I noticed that I couldn't connect to our mail server, and our site was down. A little pinging established that our ISPs site was also offline. I can only assume the ADSL gremlin had a nibble at them, and hid their servers from the outside world...

Fortunately, everything was back up and running by 8:30am.

What else can I say but "We Apologise For The Inconvenience"?

Posted by Anna at 12:34 | Get Link

 

How closely integrated into Visual Studio is Visual Lint?
Tuesday, November 14, 2006

Visual Studio .NET 2002, Visual Studio .NET 2003 and Visual Studio 2005 allow extremely close integration into the IDE. Under these environments, Visual Lint will integrate its commands into the Visual Studio menubar and command bars, and even add a "Perform Lint Analysis" command to the context menu in the code editor. The three Visual Lint toolwindows can be docked anywhere in the IDE, and can be pinned and autohidden just like any other window.

Under Visual Studio 6.0 the level of integration we can offer is, unfortunately, more limited. Visual Lint will still create its own toolbar (named "VisLint" rather than "Visual Lint" due to the rather low level method we have to use to set the name), but it cannot add commands to the menubar or control the state of the toolbar commands (disabled, selected etc.) as Visual Studio 6.0 simply does not provide the capability for add-ins to do this.

Even worse, the IDE does not provide any capabilities to integrate third party toolwindows. We have, however, been able to integrate them into the VS6 Workspace View (but not the Output Window - at least not yet) using window subclassing techniques.

The good news is that we hope to address the two major outstanding issues (integration into the Output Window and control of the state of command buttons on the Visual Lint toolbar) in the not too distant future. Both features are currently planned to be included in Visual Lint 2.0.

Posted by Anna at 13:02 | Get Link

 

Visual Lint 1.5 has been released
Sunday, November 12, 2006

I'm happy to announce that after 6 months of solid development (of which the last month has been particularly busy) we've finally got to the point where we consider Visual Lint 1.5 (build 1.5.0.60, to be exact) to be ready to let loose on the developer community. This build includes two notable additions - support for Visual Studio 6.0 and Visual C++ 6.0 (by popular request!) and support for Professional Edition licence features.

Incidentally, Visual Lint 1.0 Standard Edition licences will work with the new version without change. They can also be upgraded to Visual Lint 1.5 Professional Edition licences at a substantial discount.

I've just finished uploading the files and updating the public site, so I'm taking a short breather to catch my breath and plan our tasks for the coming weeks.

As the new version requires updated key generator to our online merchants and this could take a few days to integrate, I'm holding off sending out any mailing to the public mailing list until it's in place.

In the meantime, please consider this a "heads up"!

Posted by Anna at 23:13 | Get Link

 

European Shareware Conference 2006
Monday, November 06, 2006

The Marketing Panel get to grips with some tricky questions from the floor

We've just returned from the European Shareware Conference 2006 at the Crown Plaza Hotel in Cambridge. Despite the name, it was heavily focused on ISVs (micro and not so micro), and the content was highly relevant - addressing such issues as marketing, security (a couple of very useful discussions on hardware and software based solutions), Vista compatibility and custom installer design to mention but a few.

Unlike most conferences (often large, anonymous affairs) this one was highly personal, and there was a strong sense of community. I guess the fact that the first item on the schedule was "meet in the pub the night before" (where the Digital River and Microsoft contingents were having a good go at leading the party!) was a bit of a giveaway...

All in all, we're had a very busy couple of days. Not only have we learnt a great deal, made some very useful contacts and had the opportunity to demonstrate our software to some very interested delegates and exhibitors (including Michael Lehman - the head of Microsoft's Vista Evangalism Programme, and the guy behind Project Glidepath) but we also ended up giving a podcast interview on Saturday morning. That's definitely a first!

Next year the Conference is in Cologne, Germany. After our experience this weekend, we'll definitely be there.

Postscript: There's a very complete account of the conference on the Ubercode news blog, and a gallery of photos which give a good idea of the atmosphere of the event on sharewarepromotions.com courtesy of Dave Collins. Enjoy.

Posted by Anna at 22:16 | Get Link