Upload
anne-campbell
View
217
Download
1
Embed Size (px)
Citation preview
BDD + UADD using Slim
Presented byRavichandran Jv
The Holy Grail
• As a <role> The Context
• I want... The Feature
• So that… The Business Value
Given, When, Then
• Given a scenario Context
• When an input is made Event
• Then ensure some outcomeOutcome
BDD
“B” for Behavior or Business?
• Although, popularly known as Behavior Driven Development, the context of business comes from the initiation of the requirements by the business in the form of Scenarios, which drives the development.
“B” for Business
• As an ATM user,
• I want to withdraw cash from the ATM
• So that I don’t have to waste time finding a bank!
• At the outset this seems to be a simple requirement. But, in actuality, the story “unfolds”, so to speak, only when the different scenarios are unveiled!
Scenarios - “B” for Behavior• Scenario 1: Valid card/user
Given the ATM card/user is validAnd the dispenser contains cashAnd the user account has funds
When the user withdraws cash
Then ensure the account is debitedAnd ensure cash is dispensedAnd ensure the card is returned
Scenarios - “B” for Behavior• Scenario 2: Valid PIN
Given the ATM card is valid and PIN is validAnd the dispenser contains cashAnd the user account has funds
When the user withdraws cash
Then ensure the account is debitedAnd ensure cash is dispensedAnd ensure the card is returned
and etc.
BDDThe fine line of difference between Behavior and Business
• Scenario or behavior is nothing but a set of business rules that help in defining the acceptance criteria.
• Satisfying business rules may lead one to understand it as Business Driven Development but for the sake of conforming to common usage, I will use Behavior Driven Development.
UADD
• The User Acceptance Criteria (UAC) drives development here and helps identify progress.
• The UAC, therefore, helps in providing the right measure of progress.
• UACs also provide the additional advantage of always having clear requirements.
In conclusion…
Requirements
• Business Rules + Scenarios = User Acceptance Criteria.
• BDD + UADD = Peace of mind!
Tools
• JBehave• AgileDox• Rspec for Ruby
And, of course,• Slim
A very brief introduction to Slim
Slim
• What is Slim?• An acronym for Simple List Invocation
Method• Used like Fitnesse • Has its own Test System called {slim}
Slim & Fitnesse
Slim Fitnesse
Decision Table Fit Column Fixture
Query Table Fit Row Fixture
Script Table Fit Do Fixture
On to the workshop…
• Given • a series of strings of the pattern, “AT<2 letters>, A<2 letters>”
• When • there is an input, “AT<GC>, A<TA>”,
• Then • a pattern of string – 1st two letters (AT) + the 1st letter in the
1st angular brackets (G) + the 1st letter of the 2nd string (A) + the 1st letter in the 2nd angular bracket(T) should be generated and so on.
Thank you!