November 30, 2004

JBehave II

JBehave expects the story and its acceptance criteria to be specified in a particular format. The aim is to specify the behaviour of the system through the acceptance criteria.

An example:

Story: Request Cash

As a bank account holder
I would like to withdraw cash from an ATM
so that I do not need to visit my branch.

Acceptance Criteria: Successfully withdraw cash

Given successfully login from user login
and the account is in credit [balance = 50]
When the user requests cash [request 20]
Then reduce balance [balance = balance – 20 =30]
and dispense cash [dispense 20]
and return card

Acceptance Criteria: Prevent cash withdrawal when overdrawn

Given successfully login from user login
and the account is in overdrawn [balance = -50]
When the user requests cash [request 20]
Then refuse cash
and return card

Acceptance Criteria: Successfully withdraw cash when overdrawn but within overdraft limit

Given successfully login from user login
and the account is in overdrawn [balance = -50]
and the account has an overdraft limit [limit = 100]
When the user requests cash [request 20]
Then refuse cash
and return card

Posted by chrismatts at November 30, 2004 4:54 PM