Microsoft Pex: Unit Testing++

Almost a year and a half ago, I read something somewhere about a Microsoft Research project called Pex.  They were working on ways to supercharge unit testing within Visual Studio, but very little information was available at the time.  They had a site with an RSS feed, though, so I added them to my reader, and went away.

Since then, they've dropped exactly 22 updates on their web site, and most of them were pretty dry reading.  They announced a 0.6 release back in August, though it was pretty meager.  In the last month or so, though, things are really picking up speed, racing towards a public debut at PDC next week.  Today, they announced their 0.8 release, and it's finally starting to demonstrate some of the coolness they promised early on.

The problem that Pex aims to fix is lousy unit testing - either because you just didn't build tests, or because you built really lousy tests.  You know the tests I'm talking about: you build out tests just to get your code coverage where you want, or maybe you even write your tests first, but you only test one or two paths through your code, leaving lots and lots of fringe cases out there to bite you.  Pex can help with this by finding those "interesting" paths and fringe data cases.  There's lots more to Pex than just unit test generation, but cruise the site and you'll start to get s sense for where they're going.

What you're really looking at here is functionality that's targeted for VS2010, but I can't wait to try it in VS2008.  Best of all, since this is a tool that operates with the code you write (as opposed to being part of it), there's much less risk in using a beta tool as opposed to something that's architecturally integral to your project.  If you don't like Pex, get rid of it, but you should be able to keep the unit tests you created as a lovely parting gift.

Say what you will about the Redmond Giant, but there's no denying that these guys really know how to push the envelope with developer tools.

Reblog this post [with Zemanta]

4 Replies to “Microsoft Pex: Unit Testing++”

  1. Hi, SInce I am new to white box testing so I am not able to find the solution for the below problem. Exception I am getting is as below
    — Exception details

    System.InvalidOperationException: Cannot create more than one System.Windows.Application instance in the same AppDomain. at System.Void System.Windows.Application..ctor()
    at System.Void HelplineGUI.App..ctor()

    Please do send me reply ASAP. Thanks in advance………..

  2. Hi, SInce I am new to white box testing so I am not able to find the solution for the below problem. Exception I am getting is as below
    — Exception details

    System.InvalidOperationException: Cannot create more than one System.Windows.Application instance in the same AppDomain. at System.Void System.Windows.Application..ctor()
    at System.Void HelplineGUI.App..ctor()

    Please do send me reply ASAP. Thanks in advance………..

Comments are closed.