Presentation on theme: "BDD + UADD using Slim Presented by Ravichandran Jv."— Presentation transcript:
BDD + UADD using Slim Presented by Ravichandran Jv
The Holy Grail As a The Context I want... The Feature So that…The Business Value
Given, When, Then Given a scenario Context When an input is madeEvent 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 valid And the dispenser contains cash And the user account has funds When the user withdraws cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned
Scenarios - “B” for Behavior Scenario 2: Valid PIN Given the ATM card is valid and PIN is valid And the dispenser contains cash And the user account has funds When the user withdraws cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned and etc.
BDD The 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
On to the workshop… Given a series of strings of the pattern, “AT, A ” When there is an input, “AT, A ”, Then a pattern of string – 1 st two letters (AT) + the 1 st letter in the 1 st angular brackets (G) + the 1 st letter of the 2 nd string (A) + the 1 st letter in the 2 nd angular bracket(T) should be generated and so on.