Write a story.

Use cases should tell an interesting narrative.

When writing tests that describe a system’s behavior, you should gather them together in a way so that they tell a story.

Individual tests follow the basic rules of storytelling. Starting with a beginning, the author describes the setup of initial variables and conditions. Establish the context of the story. Why is the user here, and what is he trying to accomplish?

In the middle of the tale, the author explains how people will use the software. The story reveals its dramatic points as the main event occurs. The test script exercises the applications in the story.

The end shows the final condition. The script compares the results to expected values. Did the story have a happy ending?

You can describe the three parts of a test in such a way so that they tell a consistent story. Then, you can gather several small stories (individual tests) together to define a larger narrative. Writing tests in this way is not only more interesting, but it also leads to a more descriptive representation of actual business cases.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: