Is it possible to define the number of tests which are generated from IntelliTest?

94 Views Asked by At

Basically title.

I just got into IntelliTest and started with a parameterized Test. When I Run IntelliTest it generates a new [TestClass].[TestMethod].g.cs with a couple of calls to my new test method. Is it possible to define the number of tests which are generated?

1

There are 1 best solutions below

0
On

Yes.

A PUT (Parameterized Unit Test) serves as the specification for the code under test and determines the tests that are generated.

But since you are new to IntelliTest, see here https://devblogs.microsoft.com/devops/smart-unit-tests-a-mental-model/ to get an overview of how IntelliTest goes about exploring your code in order to generate a compact test suite with high coverage.

To get most control over the tests that are generated, write your own PUT for IntelliTest to use. See here for an example of writing a PUT: https://devblogs.microsoft.com/devops/intellitest-hands-on/.

Furthermore, you can configure these exploration bounds, which in turn can influence the number of tests that might get generated. See here https://learn.microsoft.com/en-us/visualstudio/test/intellitest-manual/?view=vs-2019 (under "Exploration Bounds") for details on all the bounds that can be configured.

Also, here is a larger set of references on IntelliTest for your reading: https://github.com/pvlakshm/Samples/blob/master/IntelliTest/references.md.