BDD + UADD using Slim Presented by Ravichandran Jv.

16
BDD + UADD using Slim Presented by Ravichandran Jv

Transcript of BDD + UADD using Slim Presented by Ravichandran Jv.

Page 1: BDD + UADD using Slim Presented by Ravichandran Jv.

BDD + UADD using Slim

Presented byRavichandran Jv

Page 2: BDD + UADD using Slim Presented by Ravichandran Jv.

The Holy Grail

• As a <role> The Context

• I want... The Feature

• So that… The Business Value

Page 3: BDD + UADD using Slim Presented by Ravichandran Jv.

Given, When, Then

• Given a scenario Context

• When an input is made Event

• Then ensure some outcomeOutcome

Page 4: BDD + UADD using Slim Presented by Ravichandran Jv.

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.

Page 5: BDD + UADD using Slim Presented by Ravichandran Jv.

“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!

Page 6: BDD + UADD using Slim Presented by Ravichandran Jv.

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

Page 7: BDD + UADD using Slim Presented by Ravichandran Jv.

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.

Page 8: BDD + UADD using Slim Presented by Ravichandran Jv.

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.

Page 9: BDD + UADD using Slim Presented by Ravichandran Jv.

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.

Page 10: BDD + UADD using Slim Presented by Ravichandran Jv.

In conclusion…

Requirements

• Business Rules + Scenarios = User Acceptance Criteria.

• BDD + UADD = Peace of mind!

Page 11: BDD + UADD using Slim Presented by Ravichandran Jv.

Tools

• JBehave• AgileDox• Rspec for Ruby

And, of course,• Slim

Page 12: BDD + UADD using Slim Presented by Ravichandran Jv.

A very brief introduction to Slim

Page 13: BDD + UADD using Slim Presented by Ravichandran Jv.

Slim

• What is Slim?• An acronym for Simple List Invocation

Method• Used like Fitnesse • Has its own Test System called {slim}

Page 14: BDD + UADD using Slim Presented by Ravichandran Jv.

Slim & Fitnesse

Slim Fitnesse

Decision Table Fit Column Fixture

Query Table Fit Row Fixture

Script Table Fit Do Fixture

Page 15: BDD + UADD using Slim Presented by Ravichandran Jv.

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.

Page 16: BDD + UADD using Slim Presented by Ravichandran Jv.

Thank you!