Hi Gerry,
As others have said, what's important is that you are doing
> Hi ... first, I know, the best way to answer my the question
> stated in my subject would be to master both and answer it
> myself. Sorry, like most developers, I am pressed for time.
> So much to learn. So little time.
Sure... it's a reasonable question.
> Second, please, I am not being a troll. Please do not flame
> one another. The question is meant to solicit "objective answers"
> to the extent that being objective is possible.
Don't expect complete objectivity here. The list is frequented
by people who use and work on NUnit. OTOH, I would not expect any
flaming on this list either.
> Third, many of you know the saying "if your only tool is a
> hammer, all of your problems tend to look like nails".
> Sometimes having more than one tool for the same task is
> advantageous, other times may be simply overkill.
Most xUnit implementations are fairly equivalent, subject
to the objectives of the developers. Start by reading the
high-level info about each project, where it exists, so
you understand why (for example) one may aim for backward
compatibility and another may not. It's easier to interpret
lists of features once you have this background.
As a coach/consultant, I tell my clients who don't use any
test framework to use NUnit, because I can best help them
with NUnit - sometimes providing custom code. OTOH, I tell
those already experienced with a framework like mbUnit or
xUnit.net to stick with it and work with those frameworks
myself. A developer with the right skills will create good
tests in any one of these frameworks.
I also advise clients *not* to use NUnit for acceptance
testing, leaning toward Fit if they don't already have
something.
I mention all this because I think my own view is fairly
common in this community: these frameworks are more alike
than they are different, and you can learn well on any
of them and switch easily should the need arise.
> Fourth, my motivation is two fold. (a) curiosity and (b)
> deciding which framework to master first (assuming that both
> xUnit.net and NUnit are worth mastering). I have no hidden
> agenda. I am new too TDD and test first testing. Ergo, with
> you cooperation, I would like to "pick your collective brains".
Mastery takes a while but just learning to use either of them
won't take you long. You may want to consider spending two
weeks with each of them first, unless some of the specific
points people list lead you to choose one over the other.
>
> Therefore, please share your opinions about the pros and cons
> of NUnit compared to xUnit.net.
* One point that is often overlooked: xUnit.net requires .NET 3.5
or higher - I assume 4.0 is on the way. NUnit can run tests using
.NET 1.0, 2.0, 3.0, 3.5 or 4.0, Mono profiles 1.0, 2.0 or 3.5 and
compact framework (via NUnitLite) 1.0, 2.0 or 3.5. Silverlight
support is coming in NUnit 3.0. If backward compatibility has any
importance to you, this may be worth considering.
[That's a great example of what I meant by looking at the high-level
goals of each framework. NUnit has a goal of retaining backward
compatibility. We may or may not succeed at it, of course, but a
project that doesn't have it as a goal won't do it at all. It's up
to you to decide if that's important to you - as well as any of
the other high-level goals.]
* NUnit provides a number of ways to run tests: one AppDomain,
multiple AppDomains, single process, multiple process, etc. Via
pNUnit, you can run parallel distributed tests. More general
parallel testing is coming but it's probably coming in xUnit.net
as well.
* NUnit is trying to implement Theories in a way that is consistent
with JUnit and with David Saff's research on the subject. xUnit.net
simply uses 'Theory' to mean what we call a data-driven test.
* NUnit is moving (with 3.0) toward support of other kinds of tests
besides unit tests. AFAIK, xUnit.net isn't going that way.
* xUnit.net currently has some easy ways to do certain kinds of
extensions at the framework level. NUnit has a harder-to-use approach
that is more broadly applicable to doing things like extending the
Gui as well. We're borrowing some of the xUnit.net approach in
3.0 so that simple things can be done more simply.
[That last is something to bear in mind. When you just list features,
what is missing one month from one of them will appear the next month.]
Others may have more points to share.
Charlie