xUnit.net, one more to the mix.

I was away on vacation this week and when ever I go away the week is eventful, I came back to the news that Phil Haack has taken the red pill and James\Brad have been busy. My congrats to Phil on his news, I look foward to working with Phil as part of the ASP Insiders. James and Brads (met Brad last year, not sure if Brad remembers but he's a nice guy) new framework, xUnit.net is an interesting addition to the current set of test frameworks in .NET land. Roy, Scott and Bill all have views and Brad has addressed some questions and I'll let you look there for further information. I'll add my thoughts on XUnit only where MbUnit is involved, I'll start with Bill's points first.

Like Roy, I'm not about to jump on this bandwagon and I don't suggest you do either. If you're looking to start writing new tests with it, I guess it's okay (other than the things mentioned above) but that's for you to decide. If you're looking to replace NUnit or MbUnit with XUnit.NET forget it. It's not worth it as a lot of your tests might break or worse case, you'll have to actually just replace code via rename because of the syntax.

XUnit does add something new and different to the mix and its good to see a different path being tread. For those of you looking at making a switch as always you need to balance the fact that XUnit is still new, may have bugs and will not have not matured yet. Of course if your using NUnit then you must consider in NUnit you have plenty of docs/books an examples coupled with unqiue features like rich Mono support. 

In both MbUnit\NUnit XUnit.Net covers some ground but also looses some ground too. No support for Collection or Array asserts (and in MbUnit that extends to Compiler, Reflection and File asserts). Sure you could write these for XUnit and prehaps based on the same mech as NUnit means your sharing some code. However the features and tools in both MbUnit\NUnit are ready baked\tested and used for you to put to use right away in addressing your testing needs.

On the positive side, there is extensibility but I have to ask. Why oh why can't we all get along? NUnit is great but I've recently (the last couple of months) shifted over to MbUnit which seems to have a little more life and there are some nice features I'm getting productivity out of. Why couldn't say the 3 cheeses (Andrew, James, and Charlie) get together to say "Let's build a unified framework". On unit testing framework for .NET to rule them all.

I speak to Charlie as often as I can and we are both seeking to expand co-op across MbUnit\NUnit for the good of our use bases. For example I am keen to expand our reporting format co-op so that tools like CI tools can work with one format reguardless of test framework. It is areas such as this that do deserve the most attention, prehaps Microsoft could mediate this, who knows.

Data driven testing

One thing I have heard a little about from Roys posts is the XUnits datadriven testing attribute Theory, datadriven tests are not soley unique to MbUnit. MSTest has database and file based data fixtures and outside of .NET you can also find them in TestNG. The row attribute is popular in MbUnit but she also has fixtures for the even more powerful Pair-Wise testing approach. We are going further with this in Gallio and alpha 1 is edging every nearer.

While you wait Jeff has today announced his extensions for MbUnit 2.4 that are in the vein of Gallio but allow you to enpower your row tests using MbUnit 2.4.

XUnit Test matrix

A test matrix between NUnit\MbUnit\XUnit and MSTest was brought to my attention and it's only fair that I add corrections if your looking at it also.

1 Comment

Comments have been disabled for this content.