File size

File size

File size

File size

78.0 MB

Ever wonder how the Reactive Extensions get tested? Jeffrey Van Gogh gives
a glimpse at how they do it. The Rx developers have been using Pex and writing parameterized unit tests. In this video, we look at Enumerable.Zip and how we can use Pex
to help testing it.

Jeffrey also explains how they use Pex in their build process to regenerate the entire unit test suite on each build!

In our team we use a checkin system popular inside Microsoft that does verification before checkin. Source changes get packaged up, send to a server. The server kicks off a build with the code changes, starts up a bunch of vms, installs the product and runs
test on it. Only if everything passes the code is checked in by the server.

In this system adding pex is very easy as you can write test scripts in any (scripting) language you want as long as there is a commandline to execute. Not sure how much work it would be to get it going in TFS...

i got confused because one of the major new features of tfs 2010 is what is called gated check in (i belive) that does pretty much what you said, it makes a tfs shelve set and builds that and run a set of MsTest tests and if they pass, the shelve set gets
checked in.. i just assumed that was what you ment

but if you're not using tfs, what are you using? svn+hooks? source safe? or is it an internal source control system?

As Jeffrey mentionned, Pex comes with a command line that allows to re-generate the test suite. In fact, the Pex Visual Studio addin launches the same command line when running Pex.

The command line comes with an option to specify to Pex that it should fail the run whenever a new *failing* test case is generated. By using this flag, you can ensure that your test suite stays 'Pex clean'.

Hmmmmmm.....I believe that what has been implemented here is a step backwards from TDD.

In traditional TDD you write out your contract in human readable test names with human readable failure messages. When I go to read the unit tests for a class I can just collapse to definitions and just read the name of the tests. When the tests run and
fail I can tell why. I imagine Zip2() is not a very helpful test name. Also I imagine maintaining the one large coupled Pex meta test method would be clumsy and easy to accidentally remove functionality.

Remove this comment

Remove this thread

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums, or
Contact Us and let us know.