NML

Aims of a test case name

Posted on 16 September 2019
Remy Brecht

It’s important to choose good names for test cases for various reasons:

Test case names are internal to the project:

Unless you have written your own extensions that make use of test case names, the test case names remain completely internal to the project. There is no need to write names in camel case, or to use_underscores. You can use plain text and include white spaces to make them easy to read.

Example: SA Resident that qualifies for a reduced rate accepts the declaration and can navigate to the next step

Basic naming guidelines:

The easiest rule of thumb for test case naming is to describe what the test case does – no more and no less. Bear in mind that although you do want to be able to identify what the cest case does, you don’t want names that don’t fit on the screen anymore If you’re using categories to structure the cest case crowser (which you should), then your cest case names don’t need to be exhaustively descriptive. They just need to give you enough detail for the contexts they’ll be used in.

Choosing a name:

The first and most likely thing the name will contain is either the action or the aim of the cest case, for example:

If the cest case acts on one particular component, then it’s a good idea to mention this in the name as well:

And if you have a cest case that works with very specific (i.e. hard-coded) data, then mention that too:

Being specific about meaning:

Often, it is worth being very specific test cases name.

If you have a test case that checks whether a checkbox is activated, and, if it isn’t activates it (using a retry Event Handler), then you could consider calling the Test Case:

Using “make sure” instead of “check whether” is an important semantic difference: regardless of the state of the checkbox in advance, this Test Case will result in the checkbox being activated.

Standard test cases:

Another useful naming convention is to preface any low-level (usually single-action) modules you create with the word “standard”. This is most usually the case if you take one of the unbound modules installed with the tool and reuse it in your own test case so that you can hard-code data that will probably never change for your project, for example:

Names can change:

Even once you’ve named something, that doesn’t have to mean that the name is set in stone. If the name is causing confusion, then change it. And most importantly, if a relevant aspect of the test case itself changes, then make sure you change the name too!

An error has occurred. This application may no longer respond until reloaded. Reload