by mark shiffer
16. July 2010 17:03
Pex is an automated unit testing generation tool that Microsoft Research has had out for a while now. Essentially Pex generates various input parameters for your methods helping to find the variations that should be testing to get good code coverage.
The PexForFun website provides an interesting set of code challenges while using Pex to drive it. You are given a starter method that is stripped down to be barely functional and that fails the Pex generated tests. Your goal is to alter the method such that it will pass the tests without any outside knowledge as to what the code is supposed to do and without knowing the Pex unit tests until they fail. It is an interesting approach to advertising what capabilities Pex has and can be a little addicting too.