Pex - Automated Whitebox Testing for .NET : Crafting Test Names

Crafting Test Names

Naming unit tests is a controversial topic, where different trends fight each other over with convention is the best. With Pex it's even worse: Pex generates dozens of new unit tests and names them himself!

Crafting the meaningful generated unit test names is not an easy task, at least in an automated fashion. How can the machine translate a program trace to a higher level, consice, english correct, test name?

In Pex, we have default naming scheme that works in a simple fashion using timestamp. Because we understand that people will want to plug in their own logic, we've made sure that this mechanism is extensible.


Inherit from PexTestNamerAttributeBase attribute, and implement the IPexTestNamer interface.

See the Samples.Pex sample for an example of such extension.
(c) Microsoft Corporation. All rights reserved. pex Wiki Documentation 0.93.50813.0