Unit Test Generators Extensibility – hats off to our community

Pratap Lakshman

It was the early feedback and support from the community that encouraged us to ship IntelliTest and the Create Unit Test method stubs features. That feedback continued as we got clear asks to support (1) the xUnit.net and NUnit test frameworks, and (2) emit tests into existing test projects. Our intent was to make these features extensible, and then work with the community so that such support could be added, and evolved independently. And indeed here they are – extensions for the unit test generators that support these asks, and provided by the teams from NUnit and xUnit.net:

With the Create Unit Tests feature, these additional test frameworks will light up in the dialog box when these extensions are installed.

IntelliTest needed a similar approach. The “Run IntelliTest” command enables exploring the input/output behaviour of the code-under-test and preview the generated test cases before opting to save one or more of them. The test framework used in the generated tests shown in the Exploration Results window and the test framework used when those tests are subsequently saved must be the same; if not it would be confusing. Therefore, similar to the Create Unit Tests command which emits unit test stubs, we introduced a Create IntelliTest command- this command pops up a similar dialog which lights up with these additional test frameworks when these extensions are installed, and emits the parameterized unit test with an attribute indicating the desired test framework to use. Subsequent invocations of Run IntelliTest on the associated code will generate unit tests in the desired test framework.

And in both cases, the tests can be saved into existing test projects as well.

Stewart Brand’s classic How Buildings Learn: What Happens After They’re Built posits that buildings improve with time – if they are allowed to, and that they will grow and adapt best when constantly refined and reshaped by their occupants. So too with these features – they will grow and adapt best when constantly refined and reshaped by your feedback and support.

0 comments

Discussion is closed.

Feedback usabilla icon