Continue Pex run in Visual Studio 2015 RC intellitest till dynamic coverage block numbers match

541 views Asked by At

Below is an image of a behavior that I do not understand when using intellitest. Notice the green did not get all the way to the end of the progress bar and right next to it is the current dynamic coverage measure which is 3/7 blocks. enter image description here

Shouldn't I be able to CONTINUE my test run all the way till the progress bar fills to completeness and the block measure numbers match. I don't see a continue button -- clicking the run button causes the test run to re-test and then result remains the same.

1

There are 1 answers

0
Arun M On

Intellitest uses a technique called dynamic symbolic execution, where it keeps on generating inputs to any statement which helps cover a code path. Read about it here.

If intellitest is unable to generate an input which can help it cover a path, it flags the case as a warning.

The less coverage count just means intellitest was unable to reason about the code. Some of the usual cases which block automated reasoning are

  • Methods that can't be instrumented, there's simply no way to understand what input values to pick up or how many uncovered blocks lie in the method body
  • Complex objects that can't created easily. Intellitests tries best to mimic object construction by calling the (parameterized) constructors, however sometimes it fails because the creation involves initialization logic, or calls to methods that are not instrumented

In the second case, intellitest shows an Object Creation warning. It shows you what Factory it used to create an object and provides you a chance to override that and possibly inject Mocks/Fakes/Dummies etc..

Warnings tell that tool needs your help to reason about code and explore more tests. The course of action in this case would be:

  1. Check the object creation warning
  2. Click Apply on toolbar if you think this factory is appropriate
  3. Modify the factory as appropriate
  4. Run intellitest again

Still if coverage numbers are not met, see if the input values generated by intellitest are adequate, you may use additional assumptions to guide the input generation (see PexAssume, msdn reference.