Using Pex to automate white box testing

Pex testing is all about finding things in your code that you didn't know existed or should be tested. The challenge doing Pex is how to paramterize your tests and how you can assert that the test did what you expected based on these parameters.

Following the development approach shown in the Lessons Learnt we used Pex to help test a complex area of the application. Using the Happy Path we were able to develop the code to a point we were happy, we actually used a Pex Method as part of the test and manually provided the paramteres. Once complete we were able to allow Pex to further explor the code and provide additional test scenarios.

Pex Testing with Manual Test Parameters

Patterns

As developers mature they learn to see patterns, whether thats for testability or just good design principles. Learning these patterns take time and practice. Getting value from Pex also requires time and practice, being able to spot test patterns helps you get value from the tools.

Last edited Apr 7, 2010 at 12:26 PM by jamesafisk, version 3

Comments

No comments yet.