April 6, 2015

...Learn TDD with Codemanship

Acceptance Tests - The Difference Between Outcomes & Implications Of Outcomes

A little thought to end Easter Sunday.

When writing acceptance tests, I encourage people to distinguish between outcomes and the implications of outcomes.

It's a subtle difference. Imagine we have a test for winning the lottery jackpot. The outcome is that the prize money is credited to the bank balance of the winner. Once they have the money, they can buy a yacht.

Buying a yacht is not an outcome of winning the lottery. But winning the lottery makes it possible to buy a yacht.

Similarly, the outcome of registering as a member of a video library is not that you can borrow videos. Being a member makes it possible for you to borrow videos. But the outcome is that you are now on the menber's list of people who can borrow videos.

Do you see what I'm getting at?

Outcomes in acceptance tests should describe the changes in state of the system's data - a change to a bank balance, or a change to the list of registered video library members.

Such changes may make pre-conditions of other use cases true, like borrowing videos. But that's not an actual outcome. That's enabled by the outcome.

So, the next time you're writing acceptance tests, and detailing the outcomes of a user action or system event, look for the changes, not the implications of the changes.

Posted 6 years, 3 months ago on April 6, 2015