2011-11-02

Given, When, Then - Which Tense?

If you do impromptu writing of BDD steps in your scenarios you will experience a broad variety of wordings for the same thing. Sometimes its just because you switched between present tense, past tense or future.

Having a best practice at hand for choosing the right tense will at least reduce the number of varieties. My recommendation is:

@Given - Past Tense

@Given describes a precondition. Something that already should have happened. Thus my recommendation is to use Past Tense here.

@When - Present Tense

@When describes an action you do just right now. I think Present Tense matches here very well.

@Then - Future

@Then describes an expected state you will reach. I think Future fits here best.

What do you think?

And what about you? Do you have any standards here?

No comments:

Post a Comment