Questions tagged [pex]

Microsoft Pex is a Visual Studio add-in that generates automated white-box tests for .NET Framework applications.

Microsoft Pex is a Visual Studio add-in that generates automated white-box tests for .NET Framework applications. Integrating into the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage.

225 questions
61
votes
1 answer

How to tell Pex not to stub an abstract class that has concrete implementations

I'm trying to use Pex to test some code. I have an abstract class with four concrete implementations. I have created factory methods for each of the four concrete types. I had also created one for the abstract type, except as this nice thread…
Andrew
  • 14,325
  • 4
  • 43
  • 64
29
votes
2 answers

Is Pex (Test generation) really useful tool?

Yes, it is possible to generate tests on boundary values for functions like "Sum" or "Divide". Pex is a good tool here. But more often we create tests on business behaviour. Let's consider example from classic Beck's tdd book: [Test] public void…
Yauheni Sivukha
  • 2,586
  • 20
  • 22
28
votes
6 answers

C# - What does "\0" equate to?

I am playing with Pex and one of the parameters it passes into my method is "\0". What does that mean? My guess is an empty string ("") based on the content of my method. However, if it is the same then why not just use "" instead of "\0"? Anyone…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
27
votes
6 answers

How to use PEX in Visual Studio 2012

VS 2010 powertools installation helped to use PEX & Moles in VS 2010. Now with VS 2012, I understand that Moles becomes enriched as Fakes but hopefully PEX is retained, please confirm. Also, how to use PEX in 2012. What needs to be installed (like…
user1526577
  • 279
  • 3
  • 3
26
votes
2 answers

Contract.Requires throwing pex errors

Possible Duplicate: How Do You Configure Pex to Respect Code Contracts? Currently, when I run a pex exploration, the code contracts I created in my classes are being treated as errors in the pex exploration results. I thought when you ran pex…
Joshua Dale
  • 1,773
  • 3
  • 17
  • 25
22
votes
5 answers

Pex users: what are your Impressions of Pex and Automated Exploratory Testing in general?

Those of you who have used Pex, what do you think its advantages and disadvantages are of Pex as a tool? Also, what do you think are the advantages and disadvantages of "Automated Exploratory Testing" in general, as a supplement to TDD/Unit Testing?
Troy DeMonbreun
  • 3,860
  • 3
  • 25
  • 35
20
votes
4 answers

How can "x & y" be false when both x and y are true?

Context: I'm learning C# and have been messing about on the Pex for fun site. The site challenges you to re-implement a secret algorithm, by typing code into the site and examining how the inputs and outputs differ between your implementation and…
mallardz
  • 1,070
  • 11
  • 21
17
votes
2 answers

How do I generate "Smart Unit Tests" with Visual Studio 2015 Preview?

How do you generate "Smart Unit Tests*" with Visual Studio 2015 Ultimate Preview? *Microsoft's S. Somasegar announced "Smart Unit Tests" (Under the heading 'productivity') for Visual Studio 2015. This feature, based on Pex, uses code analysis to…
Dan Sorensen
  • 11,403
  • 19
  • 67
  • 100
14
votes
1 answer

Microsoft PEX with NUnit

I am thinking of using Microsoft PEX tools for my project, but I would much rather use NUnit instead of MSUnit. Apparently, PEX Extensions project was specifically created for that, but it has no releases now, and appears to be dead. Has anyone been…
Yuri Astrakhan
  • 8,808
  • 6
  • 63
  • 97
13
votes
1 answer

How to generate good code coverage of floating-point logic?

I am hand-crafting new code. I'd like to make sure I leave no stone unturned. Is there anything specific I can do beyond specifying Code Contracts to guide Pex so it produces good coverage in numerically-intensive code? Try searching…
GregC
  • 7,737
  • 2
  • 53
  • 67
9
votes
1 answer

Pex: Could not satisfy all requirements

I'm trying to package a python virtual environment using pex, but can't seem to shake off the "Could not satisfy all requirements for..." error. This is either me being a total python newb question, or an ask to help me find out to figure out what…
Pat K
  • 321
  • 1
  • 7
  • 18
9
votes
1 answer

Why Pex is not massive

Hi there: I was looking at a few videos, etc and I just cant help but wonder why Pex usage seems to be so low? Are there any problems that are not obvious, or is it just a licence issue?
roundcrisis
  • 17,276
  • 14
  • 60
  • 92
8
votes
1 answer

How do I specify the factory Intellitest should use for an interface?

With Intellitest you can specify a type for Intellitest to use that fits an interface when generating unit tests, however I have a custom factory I wish to use instead. My custom factory: public static partial class LogicFactory { /// A…
Nick Udell
  • 2,420
  • 5
  • 44
  • 83
8
votes
2 answers

How does Pex work

At a low level, how does Pex work? Thanks
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
8
votes
1 answer

C# Static Analysis, possible values for a variable/parameter

In code similar to each of the following examples, I would like to be able to statically analyze code to determine the list of possible values that are passed into SpecialFunction(). SpecialFunction(5); // A int x = 5; SpecialFunction(x); // B int…
Jason Kleban
  • 20,024
  • 18
  • 75
  • 125
1
2 3
14 15