Monday, May 4, 2009

Pex White box Testing

Team,

* Pex is a microsoft's free product

* Pex systematically hunts for bugs – exceptions at the design time

* Pex generates the test data automatically

* Tests can be saved as test suite

* Test suite can serve as a regression test suite in the future

* Pex can be used all type of .net Applications


Visual studio white box testing************************************ In visual studio team system, You can create unit test for all methods or selected in a particular class file.

Steps

* create a new test project* Select your assembly (dll/exe)* System will show all classes* System automatically generate unit test for you
* You have to configure the input parameters & mock objects* Run your test

* Directly write your hand written code for unit test

Note : Mock objects creation is difficult.

Using Pex:

For any method, Pex computes and displays interesting input-output pairs. Pex systematically hunts for bugs – exceptions or assertion failures. As Pex discovers boundary conditions in code,Pex generates new tests that target these conditions. The result is a small test suite with high code coverage. Pex enables Parameterized Unit Testing, an extension oftraditional unit testing that reduces test maintenance costs. Pex has been used in Microsoft to test core .NET components (Windows/Web .net Applications).

Developer Point of view:

* Pex is used to find bugs in an existing .Net assemblies.

* Pex will run your code, possibly many times with different inputs.

* Input Generator(constraint solver to determine what the relevant input values of a test and the program-under-test).

* Pex shows the results of its analysis in a separate Pex Exploration Results window as a table.

* Pex gives a precondition suggestion also.it can be added in your source code.

* we can not only save individual tests, but we can save the entire table as a test suite. This test suite can serve as a regression test suite in the future, or as a fast-running build verification test (BVT) suite, a test suite that can be executed every time a code change is submitted to the source depository.

* Code coverage results window shows what are the blocks covered and not covered details.

Tester Point of View:

* Pex shows the detailed automated steps(Create project,Test,Add reference) to create a test for a current selection.

* All .Net testing frameworks having white box testing only (MS Test,NUnit,CSUnit and other functional testing tools)

* Pex supports the following test frameworks:
MSTest,
Visual Studio test framework,
xUnit.Net,
Repro Test Framework
NUnit, MbUnit

No comments:

Post a Comment