BT

InfoQ Homepage News Pex: Unit Testing Tool from Microsoft Research

Pex: Unit Testing Tool from Microsoft Research

Bookmarks

Pex is a Visual Studio add-in and testing tool developed by Microsoft Research. It investigates, explores the managed code and suggests the tests, which the project requires. It provides support for code contracts, which are used to annotate methods with conditions such as preconditions, postconditions and invariants that must be initially verified for the code to run properly.

Pex automatically adds proper precondition to your code after a detailed analysis to catch any invalid data. On the other hand, code contracts provide additional data and information to refine the analysis done by Pex. The test project created with Pex using Visual Studio target MSTest, which is the default testing framework as well as other frameworks such as NUnit.

In order to work parameterized testing, you need to pass appropriate values to the parameters, which Dino Esposito thinks is a big challenge. According to Dino, Pex comes to the rescue and assists developers to pick meaningful input values using iteration with the help of dynamic symbolic execution technique.

You can check out Pex on the web for free. It is a simplified version of Pex power tools for Visual Studio and includes code puzzles. You just need to provide code in C#, Visual Basic or F# and all the background work happens in the cloud.

Pex Framework works only with Visual Studio 2010. However, if you work with Visual Studio 2012 then you need to make use of Microsoft Fakes framework.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.