---
title: "MbUnit vs. NUnit Vs. Team System Unit Testing - Choosing a unit test framework"
url: "https://osherove.com/blog/2006/9/23/mbunit-vs-nunit-vs-team-system-unit-testing-choosing-a-unit.md"
canonical: "https://osherove.com/blog/2006/9/23/mbunit-vs-nunit-vs-team-system-unit-testing-choosing-a-unit.html"
published: "2006-09-23T17:51:00"
updated: "2006-09-23T17:51:00"
tags: ["Agile", "Agile Related", "Art Of Unit Testing", "Unit Testing"]
author: "Roy Osherove"
description: "Update : There's a new Unit test framework called XUnit.NET. More info here. MbUnit is gaining some momentum as one of the nicest unit testing frameworks for .NET out there. I just came out as an RC2 release with many…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# MbUnit vs. NUnit Vs. Team System Unit Testing - Choosing a unit test framework

By Roy Osherove September 23, 2006 In [Agile](https://osherove.com/blog/category/agile), [Agile Related](https://osherove.com/blog/category/agile-related), [Art Of Unit Testing](https://osherove.com/blog/category/art-of-unit-testing), [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published September 23, 2006; technical details may be outdated.

**Update**: There's a new Unit test framework called XUnit.NET. [More info here.](https://osherove.com/blog/2007/9/21/xunitnet-aims-to-be-the-next-nunit-but-its-too-soon.html) 

[MbUnit](http://www.mbunit.com/) is gaining some momentum as one of the nicest unit testing frameworks for .NET out there. [I just came out as an RC2 release](http://weblogs.asp.net/astopford/archive/2006/09/22/MbUnit-RC2.aspx) with many new features an enhancements, including dull support for [NUnit](http://nunit.org/) 2.4 Asserts - which is a big deal.

The two coolest features that draw people to using it are:

- \[**[Rollback](http://www.mertner.com/confluence/display/MbUnit/RollbackAttribute)**\] attribute that automatically rolls back any changes to the database that were made during that test method (using a [method I developed](http://weblogs.asp.net/rosherove/archive/2004/07/20/187863.aspx) with [COM+ 1.5](http://72.14.221.104/search?q=cache:bk37LPahGOUJ:blog.dotnetwiki.org/archive/2004/07/20/634.aspx+mbunit+rollback&hl=en&gl=il&ct=clnk&cd=1))
- \[**[RowTest](http://www.dotavery.com/blog/archive/2006/09/07/20030.aspx)**\] attribute that allows declaring one test with several inputs (acting as several tests).

I also like MbUnit's extensibility model with is largely different than that of NUnit's and is easier to conform to when writing new attributes.

MbUnit is also one of the topics that I continually have a dilemma about using. Since its not the **de-facto** standard out there, I always feel there's a chance of it being frozen in mid development, making all those who depend on it frozen along with it.

_**\[Update**: Andrew, one of the leads on mbUnit,_  [_makes some good points_](http://weblogs.asp.net/astopford/archive/2006/09/25/Roy-on-MbUnit.aspx) _on why he thinks this is far from happening - which is reassuring, and I'd like to hold out longer befomre making a final call on it's "frozeability".\]_

I still recommend people to use NUnit as the standard. You can do a lot with NUnit (as well as the rollback attribute - See [XtUnit](http://weblogs.asp.net/rosherove/archive/2004/10/05/238201.aspx) for that). When you get used to it, **then** I suggest you check out MbUnit. you'll have the tools to whether you really can't live without it.

As long as there are two primary contenders in the unit testing world for .NET (NUnit and MbUnit - don't even get me started on Team System Unit Tests I discuss them in a bit) - there will always be that dilemma and the situation will always be a bit confusing for newcomers into this world.

If your heart is set on using MbUnit (and it **is** a good platform - I'd use it in a heart beat if a client was using it that I was consulting to) - I recommend using [TestDriven.NET](http://testdriven.net/) along with the unit tests. It just makes it much easier (plus you don't have to worry about any custom UI to run them in - it runs NUnit and MbUnit tests with no problems).

**What about Team System unit testing?**

For now the unit tests framework in team system and VS 2005 cannot be the de-facto standard for several reasons:

- [It sucks too much](http://weblogs.asp.net/rosherove/archive/2006/01/25/436414.aspx) right now. They have waay too many bugs in them (excepted exception attribute especially broken
- It doesn't have enough features and asserts to support the most common cases
- It's not free for everyone to use ( [you can't even use it with the VS express editions](http://blogs.msdn.com/jason_anderson/archive/2004/06/04/148252.aspx) - shame on you!)
- It requires VS 2005 to run (no separate run-time UI - although there is a command line)

A good unit testing solution should solve at least these four basic points in order to be considered as a candidate for a de-facto framework. Not even mentioning wide user acceptance : team system does not live up to its hype right now.

The only good thing going to it is that if you use Team Foundation server you can run the unit tests you wrote more easily as part of the automated build - which you can also very easily achieve if you work with any other framework such as NUnit by using a custom build action. While out of the box experience is important, and should not be dismissed easily, I do tend to still use NUnit even with Team System - as I tend to get better features, more stability and a wider range of possibilities for running my unit tests that way.

## More in Agile

[All posts in Agile](https://osherove.com/blog/category/agile)

- Sep 25, 2006

    ### [The future of unit testing tools - MbUnit, NUnit, NMock and FIT](https://osherove.com/blog/2006/9/25/the-future-of-unit-testing-tools-mbunit-nunit-nmock-and-fit.html)

- Sep 24, 2006

    ### [Continuous integration with Team System and Team Foundation Server](https://osherove.com/blog/2006/9/24/continuous-integration-with-team-system-and-team-foundation.html)

- Sep 17, 2006

    ### [Test Driven Development Related Podcasts and a few other comments](https://osherove.com/blog/2006/9/17/test-driven-development-related-podcasts-and-a-few-other-com.html)

- Sep 13, 2006

    ### [XP Simulation Blog](https://osherove.com/blog/2006/9/13/xp-simulation-blog.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
