On one project I’ve been on, all the tests began with the word “should”. Though not necessarily taking on full on BDD using anything like NBehave or JBehave, I think the simple effect of reframing tests using the word “should” worked wonders on this particular project.

We had quite a lot of people pass through the project over a year and a half, so I found it interesting to see what impact it had on tests. I observed that:

  • People focused on understanding intent first, and followed through with how it was implemented.
  • People had better conversations around differences (the test name said it should be doing this, and it’s actually doing this. They asked questions like, “Is the name of this test wrong, or is the test incorrectly implemented?”
  • The statement is not as strong as assert or must so I felt people could challenge it more, leading to better quality conversations. “I though the domain was supposed to be like this, and the test and the code does this – Am I misunderstanding something?”

I think this subtle focus brought many qualitative benefits that I think a lot of projects could benefit from.