When I first started writing unit tests, I followed the common convention in C# for method naming:

WithdrawingMoneyShouldDecreaseBalanceByAmount

Later, I adopted the convention of separating words with underscores:

Withdrawing_Money_Should_Decrease_Balance_By_Amount

At some point I figured the approach above makes the name of the method look like the title of an article. I then decided to go with the same approach, but making everything lower case:

withdrawing_money_should_decrease_balance_by_amount

In some cases, I may use uppercase if I want to draw attention to something in particular:

withdrawing_money_should_DECREASE_balance_by_amount

I like when the code is calm to look at, and it draws my attention to things as appropriate.

Leave a Reply

Trending