Aims of a test case name
It’s important to choose good names for Test Cases for various reasons:
• When you or other testers on the team are looking through the Test Case Browser, it should be easy to find out which Test Case is the one you need – and if there are a few Test Cases that are similar, then it should be clear which one is the right one for the task at hand.
• When you use the search dialog or filter field, knowing how your Test Cases are named will help you to find the right Test Case. Otherwise, you may end up thinking that there is no Test Case for the current workflow and introduce redundancies by creating a new one.
• When reading through a larger Test Case, or through a test result report, it should be easy to follow the flow and steps of the test without having written it yourself. The easier test result reports are to understand; the less time you will spend analyzing test failures when they occur.
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 camelCase, 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 Test Case does, you don’t want names that don’t fit on the screen anymore If you’re using Categories to structure the Test Case Browser (which you should), then your Test 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 Test Case, for example:
• “Open New Project Dialog”
• “Select any entry from a context menu on any tree node”
• “Fill in mandatory fields in new customer dialog”
If the Test Case acts on one particular component, then it’s a good idea to mention this in the name as well:
• “Select any entry from the languages list”
• “Close search dialog with OK button”
• “Close search dialog by pressing escape”
And if you have a Test Case that works with very specific (i.e. hard-coded) data, then mention that too:
• “Login as the administrator”
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:
• “Make sure that checkbox is activated”.
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!