Of course, methods and test classes would use whatever naming conventions you might be already using in your language. For instance:
PascalCase
camelCase
_pearPrivateMethod
Beyond that, here are some popular techniques:
In the case of unit test about a particular class, I use the “itShouldxxxx” method:
itShouldBeAbleToDoSomething();
The “it” being the class I’m testing.
In terms of acceptance tests written in the Codeception style, which is a scripting style given from the subjective point of view of the tester; we name the testing object “$I” and write call the methods in a script like this:
$I->openABrowser();
$I->amOnUrl(‘https://generalchicken.guru’);
$I->see(‘Never for money, always for love.’);
$I->dontSee(‘We are greedy MOFOs’);
In terms of Feature Files written in Gherkin, we pull method names out of the English sentances and take into account the point of view from whom the feature is written. This is usually given as an “as a/the” in the begging of the file, like this:
In order to drive traffic to my website
As a blogger
I want to make lots of Quora posts
In this case, the feature would be written “As a blogger” and a scenario might be:
Given there is a popular site “Quora.com”
When someone emails me a question
Then I answer it
So the function names would come out as:
thereIsApopularSite($websiteName);
someoneEmailsMeAquestion();
IanswerIt();