Live Unit Testing in Visual Studio

Live Unit Testing in Visual Studio

I am a big proponent of unit testing my code because of the many benefits it provides:

  • Helps me to reduce bugs by forcing me to clarify expectations for various success and failure scenarios
  • Provides a safety net for future code changes
  • Leaves a documentation trail for those that come behind me to understand my code

The only irritation/friction I have found in the past is the fact that running unit tests has required me to manually run them on a periodic basis. Having keyboard shortcuts has helped to make that fairly painless, but it would have been nice to have the tests automatically run as I am working on the code. That way I am continually receiving feedback and don't have to explicitly do anything to receive it.

While there have been custom add-on options in the past (SpecWatchr and nCrunch), Microsoft has added this functionality into the Enterprise version of Visual Studio.

Find out more about it here.

Live Unit Test Screenshot