behavior driven development pros and cons
DESCRIPTION
TRANSCRIPT
![Page 1: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/1.jpg)
The Pros of Behavior Driven Development (BDD): Business User Scenarios
Natalya Zaytseva
Exactpro Systems LLC
![Page 2: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/2.jpg)
Test Driven Development (TDD)
Test Failed
Add a test
Test Passed
Update the code
Refactor
![Page 3: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/3.jpg)
Test Driven Development (TDD)
Benefits Unit tests prove that code actually works
Refactoring allows to improve the design of the code
Low-level regression test suite
Test-first reduces the cost of bugs
Drawbacks Developers can consider it as a waste of time
Anticipation by developers the concept of “Testing”
The tests can be targeted on verification of classes and methods and
not on what the code really should do
![Page 4: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/4.jpg)
Behavior Driven Development (BDD)
Shifting from thinking in “tests” to thinking in
“behavior”
Collaboration between Business stakeholders,
Business Analysts, QA team and Developers
Ubiquitous language
.
![Page 5: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/5.jpg)
Behavior Driven Development (BDD)
Approach
a
feature1feature3
QA AnalystScenarios
Class
Developer
feature4
QA Analyst
Ubiquitous language
Behavior
![Page 6: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/6.jpg)
BDD: Business Scenarios
Story: [Narrative]
As a Role I request a Feature To gain a Benefit
Scenario Given [context] AND [some more context]
When [Event]
Then [Outcome]
And [Another Outcome]
![Page 7: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/7.jpg)
BDD Cons
Ivan Bobrov
EXTENT October 2011
![Page 8: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/8.jpg)
The Beginning
![Page 9: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/9.jpg)
Is it easy to describe?
• Scenario:
An Artist creates an art work
Given I am a registered artist
And I am on my dashboard
And I follow "Add an artwork" within "#dashboard"
When I fill in "Title" with "The Portrait"
And I fill in "Description" with "A nice portrait."
And I select "Painting" from "Category"
And I attach “portret.jpg" to "Select picture"
And I press "Create" Then I should see
"The Portrait " was successfully added to your art collection
![Page 10: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/10.jpg)
A Client and BDD is Face to Face
• With every new project I hoped that Cucumber can become one of the
communication tools between our team and the customer.
Only once I managed to get the customer write
the scenarios, however the quality wasn't good and they had to be
rewritten by a developer
• It was difficult to convince the customer to
review the scenarios on a daily basis. They preferred
writing a document or using a ticketing system like Redmine. The result is that
we have requirements in 2 places - tickets and scenarios
• Andrzej Krzywda
![Page 11: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/11.jpg)
Are developers ready for BDD?
• A developer often writes specifications
• Specs are very detailed
• Scripts, scenarios or a manual?
• Easy to understand
![Page 12: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/12.jpg)
BDD doesn’t show a real life
In BBD Scenario
NewOrderSingle
where
SecurityID=S1 and
Price=P1 and
Side=BUY and
Quantity=Q1
…
In Real Life
• Initialize TCP connection
• Send Logon to the GW
• Wait for Logon response
• Start sending HeartBeats
• Send NewOrderSingle with ….
![Page 13: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/13.jpg)
Release
A Product is ready to use
BDD it’s a design tool
![Page 14: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/14.jpg)
1770 year
![Page 15: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/15.jpg)
2011 year
![Page 16: Behavior Driven Development Pros and Cons](https://reader035.vdocuments.net/reader035/viewer/2022062510/54646e2daf7959f2058b64c4/html5/thumbnails/16.jpg)
Thank you.