How to write stories / scenarios in BDD ( Behavior Driven Design )

Lill Lansey picture Lill Lansey · May 28, 2009 · Viewed 18.7k times · Source

I am about to use BDD (Behavior Driven Design) for the first time and am trying to get used to this different way of approaching a problem.

Can you give some stories / scenarios that you would write for say a simple login application using BDD?

For example, from what I have read, it seems that is good:

When a user enters an invalid userid/password, then display an error message.

As opposed to:

Validate id and password by searching for a matching record in the database.

Answer

Kevin picture Kevin · May 31, 2009

Dan North has some excellent advice on writing stories. "Dan North- What's in a Story?"

I would also take a look at some of the work being done around Cucumber as they have spent a lot of time thinking about how to write these stories in an understandable and executable way.