Blog Post

December 2010 Developer Dinner: How to Simplify Unit Testing with Pex and Moles

Download this episode

Download Video


Microsoft Research has produced two tools to dramatically simplify the construction of unit tests.  We will look at Moles, a framework and Visual Studio add-in that helps to isolate your code from external dependencies.  With Moles you can replace any .Net method with a delegate.  Next we will examine Pex, a Visual Studio add-in that automatically generates unit tests for you.  Pex analyzes your code, looking at, for example, if statements, assertions and operations that throw exceptions, to create inputs that try to achieve 100% code coverage.

James Wren is Senior Consultant with Microsoft Services and has designed custom software for a variety of clients including the New York City Police Department, Department of Defense, and the Predator Unmanned Air Vehicle Program.  He is a strong advocate for building testable, modular software and has lectured within Microsoft and at the University of Maryland.



Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      i wont channel 9 video and free live mobile tv in my Nokia E 66

    • User profile image
      Nikolay Klimchuk

      Really nice video but hard to hear.

    • User profile image

      Interesting topic, but the video is stuttering and with poor resolution of the PowerPoint presentation. Would also like to see code examples. Also, the questions from the audience was not possible to hear.

    • User profile image
      James Wren

      I would recommend downloading the WMV. It's easier to watch and without all of the choppiness.

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.