Iāve lost count of how many times Iāve had this debate with various team members. āDescribe the test even if the name is ridiculously longā. Or āLetās keep it short and to the pointā. Or āBlah blah blah we should name it like this.ā Itās a tricky one!
Hereās my take on Michaelās approach:
Understand context, apply rules and thatās the naming convention to use
How about you? Whatās your approach to naming tests/checks?
I name my tests so that they describe at a high level the feature space/bug they are covering. Itās helped in the past when Iāve been asked ādo we have any tests that cover x feature?ā, I can easily run a search and find them.
Not only tests should be named to describe. I also try to make the test data to be self explanatory to help anybody who as do deal with it in the future.
For example for a test used to transfer a task from a user calendar to another.
User A : Firstname= āTransferā, Lastname= āInitiatorā
User B : Firstname= āTransferā, Lastname= āReceiverā
User C : Firstname= āTransferā, Lastname= āApproverā
The task could be named : āTransfer with approval test taskā
With a description that goes like this
āTask used for the task transfer test (TESTID-XXXX). Configuration: Option A=true / Option B=False / Option C=False / ApprobationNeeded=Trueā
I even find myself happy about having this info when a revisit after a while
I like many of the points raised in the original so Iāll take a slightly different perspective to provide some novelty.
Each name is a lie. A trap laid in a tacit conspiracy of silence.
Consider the limitations of your tools, consider your context, consider your needs. The name is a communication tool, so consider your audience, their context and their needs.
Then lie in a way that balances utility with risk.
If I were to suggest possible changes to check suites I rarely see Iād say use whatever names but include a review date and a purpose where possible. The check needs to prove why it deserves the cost of its existence in a changing context, and expose its own lies and lazy shortcuts, and that will make it far more maintainable and provide understanding about its attempt at coverage to different audiences, even after whoever wrote it left and the new person tries to clean it up. My biggest question when looking at check code is āwhat were you trying to achieve here?ā, especially when Iām justifying that coverage against regression suites or other testing elsewhere. Itās all part of a bigger concept of coverage, and making that information available in a usable way to other testers pays respect to them, their work and the craft of testing.
But it depends on so much context, so again - consider limitations/context/needs for you and your audience and you shouldnāt lie too dangerously.