This last week I took a great class on TDD and BDD given by Scott Bellware. During the session he showed us a cool tool called AutoHotKey. AutoHotKey is a tool that allows you to control your keyboard behaviors. For instance you can use AutoHotKey to substitute the underscore character for a space when typing in a test name
I had a discussion with my co-worker Greg Lawrence about using underscores vs. CamelCase for our test naming conventions. I have always liked underscores in test names. Test names are like sentences and should be read as such. To drive this point home (and to demonstrate it for an underscore bigot I present the following:
We hold these truths to be self-evident, that all men are created equal,
that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.
BDD CamelCase Notation
BDD Notation (Underscored)
As is self evident (pun intended) the underscored version is much easier to understand and read. When you generate documentation from your BDD specs which one make more sense? Which will is easier to use by your customers? Which ones can you substitute underscores for spaces when printing documentation? Its pretty obvious which one to choose.
Just a small thought on this march morning.