Rob Caron

Developer-related topics and other stuff.

Visual Studio Magazine - Writing Unit Tests

Visual Studio Magazine - Writing Unit Tests

  • Comments 1

The February 2006 issue of Visual Studio Magazine has an article by Jeff Levinson (who has written several other Team System articles for that magazine) on writing unit tests in Team System. You can find the online version of the article here - Write Unit Tests With VSTS.

704

  • I don't like the whole principle of creating Unit tests as an after thought. Normally developers tend to write coupled, poorly designed code that is hard to test and this leads to the situation where Unit tests are brittle and painful to maintain. After a few weeks of this pain, the developers are going to say “I’m not going to maintain this, these tests are way too painful to maintain”.

    The proper way to create a good regression unit test framework is to do it the proper Test-First approach. But to be honest, it is when you get into doing proper Test-First development and you realise how to develop with testability in mind that you start to reap the rewards of a loosely coupled design. You would be amazed at how Test-First just pushes you into better OO practices.

    This is where my gripes with the new VS2005 testing tools begin. Speed is a problem, finding anything in that Test List View is a problem. From a developer point of view, I don’t need to have any of the Test Run results. I do see a need for them from a build or tester point of view, but as a developer I think they should go or at least have the ability specify in a setting if you would like to disable the test run results and only show the last run.

    There is also a bug in the testing framework where you can’t have a base test class with a setup method and inherit the base class in your fixture. That setup method doesn’t get called.

    So I’ve ranted a bit :-)…Sorry…
Page 1 of 1 (1 items)
Leave a Comment
  • Please add 1 and 6 and type the answer here:
  • Post