*
Quick Links|Home|Worldwide
Microsoft*
Search for


Pex – Walkthrough

Pex enables a new development experience: Parameterized Test-Driven Development.

In the following, we will develop and test a Chunker: A class which partitions a given string into pieces of a given size.

Write a Parameterized Unit Test First

The following parameterized unit test states: When we concatenate all chunks, we get the original string.

Parameterized Unit Test

 

Run Pex

Just right-click the parameterized unit test, and run Pex.

Parameterized Unit Test

 

Consume Feedback

Pex reports generated test cases. Pex puts squigglies in the code indicating where generated tests failed. Pex suggests code snippets which will prevent the same failure from happening again.

Parameterized Unit Test

 

Integrates with Unit Testing Frameworks

The generated tests integrate with VSTS.

Parameterized Unit Test

 

High Code Coverage

The test cases generated by Pex give high code coverage, which can be visualized in Visual Studio.

Parameterized Unit Test

 

Next


©2008 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement