Share →
Buffer
  • Nice article, but two things:

    1. NUnit and MBUnit are generally preferred over MSUnit by 95% of the community. MSUnit has a few nasty bugs in that still haven’t been addressed as of VS 2008. See Roy Osheroves blog. http://weblogs.asp.net/rosherove/archive/2007/10/16/unit-testing-in-vs-2008-still-not-there.aspx
    Pick up Test Driven.Net or ReSharper for test integration.

    Check that, whatever you do, pick up ReSharper. You wont be sorry.

    2. Proper unit testing cannot be done without mock object support (which is not included in MSUnit, NUnit, or MBUnit). Check out Rhino Mocks for that.
    http://www.ayende.com/projects/rhino-mocks.aspx

    3. Understanding Unit Testing is the easy part. Figuring out how to write testable code is the hard part. If you are looking for a place to start, learn about “Separation of Concerns”. Jeremy Miller has a nice post on it here:
    http://codebetter.com/blogs/jeremy.miller/articles/129542.aspx

    After that, study MVP and MVC as a starting point for doing just that.

  • Pingback: Team System News : VSTS Links - 11/14/2007()

  • Thanks Chris, sorry it took so long to write back. Your points are excellent but… One of the things about this view is that there is only one way to do it “correctly”. I like to think that even without following TDD to the nth degree that developers can get benefit out of it. And there are plenty of add-ins that work with unit testing in Visual Studio. Granted, we would all like to see more built in but I don’t think Microsoft can ever really compete with the full resources of the open source community so their add-ins are a blessing! 🙂

  • MikeAzocar

    I agree with some of the points each of you made.

    Chris. You are right, Resharper makes TDD so much easier.

    Jeff. I agree that there is more than one way to be successful with TDD. You have to be flexible and take the practices that work best for the project and the development team.