2. Miért nem sörözünk már?
www.meza.hu | @vsbmeza
A BDD kialakulása
Mi, es mi nem a BDD?
Mikor fáj?
Mikor jó?
3. BDD - A kezdetek
www.meza.hu | @vsbmeza
DAN NORTH
@tastapod
"A test class SHOULD do
something!"
"Let's replace JUnit with
JBehave!"
JBehave RBehave RSpec
Cucumber
4. BDD - A kezdetek
www.meza.hu | @vsbmeza
CHRIS MATTS
@PapaChrisMatts
“But that’s just like
analysis.”
commitment-thebook.com
5. BDD - A kezdetek
www.meza.hu | @vsbmeza
LIZ KEOGH
@lunivore
"BDD and TDD aren’t
actually about making
sure that something
works well. They’re
about uncovering the
parts you don’t
understand; the parts
that are hard, and the
gaps."
6. BDD - A kezdetek
www.meza.hu | @vsbmeza
VALLÁSOK
9. BDD - Tévhitek
www.meza.hu | @vsbmeza
"A BDD lelke a bizonytalanság és a
tudatlanság - nem a példák
megtalálása, hanem az olyan
példák felfedezése, amiket nem
találunk."
Liz Keogh
10. BDD - Tévhitek
www.meza.hu | @vsbmeza
Given Fred has bought a microwave
And the microwave cost £100
When we refund the microwave
Then Fred should be refunded £100
Example uesd by: Liz Keogh
11. BDD - Tévhitek
www.meza.hu | @vsbmeza
Given a context
When an event happens
Then an outcoume should occur
12. BDD - Tévhitek
www.meza.hu | @vsbmeza
Given Fred has bought a microwave
And the microwave cost £100
When we refund the microwave
Then Fred should be refunded £100
Example uesd by: Liz Keogh
13. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Mikor fáj?
14. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Scenario: logging in
Given I am an internet user
When I navigate to http://www.facebook.com
And I click the field "username"
And I enter "boring@large.com"
And I click the field "password"
And I enter "correct horse battery staple"
And I click the button "Log In"
Then I see "What's on your mind" on the page
15. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Scenario: entering the pub
Given I am a thirsty lad
When I stand in front of a pub
And I hold the door handle
And I push it down
And I push the door
And I step into the pub
And I push the door back
And I let go of the door
Then I am in the pub
16. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Scenario: successful submission
Given I'm on the animal creation page
When I fill in Name with 'Alligator'
And select Phylum as 'Chordata'
And fill in Animal Class with 'Sauropsida'
And fill in Order with 'Crocodilia'
And fill in Family with 'Alligatoridae'
And fill in Genus with 'Alligator'
And check Lay Eggs
And click the Create button
Then I should see the notice 'Thank you for your animal
submission!'
And the page should include the animal's name, phylum,
animal class, order, family, and genus
17. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Scenario: buying beer
Given I am at the bar
When I ask for a Kobanyai
And select Consistency as 'Liquid'
And fill in Type with 'Alcohol'
And fill in Color with 'Yellow'
And fill in Family with 'Beer'
And fill in Manufactor with 'Dreher'
And check 0.5 bottle
And open the cap
Then I should hear the hiss of the gas
And the bottle should include the Kobanyai
18. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Imaperatív
Hogyan?
19. BDD - Mikor faj?
www.meza.hu | @vsbmeza
Deklaratív
Mit és miért?
20. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Imperatív, vagy Deklaratív?
Scenario: drink beer
Given I am a thirsty lad wanting beer
When I walk into the pub
And ask for a beer
And pay for a beer
Then I should be served beer
And should drink beer
And my thirst should vanish
21. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Imperatív, vagy Deklaratív?
Scenario: In-progress
Given I visit the fixtures page
When a game is in progress
Then I should see the current score of that
match
And I should see the current match time
22. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Imperatív, vagy Deklaratív?
Scenario: Signed in User can Preview comment before posting
When I typed some text in the text box
Then I should see the preview in the preview pane
And close the preview box
23. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Imperatív, vagy Deklaratív?
Scenario: drink beer
Given I am a thirsty lad wanting beer
When I walk into the pub
And drink a beer
Then my thirst should disappear
24. BDD - Mikor fáj?
www.meza.hu | @vsbmeza
Imperatív, vagy Deklaratív?
Scenario: drink beer
Given I am a thirsty lad
When I drink a beer
Then my thirst should disappear
25. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Imperatív
Deklaratív
CHUNK UP
26. BDD - Mikor jó?
www.meza.hu | @vsbmeza
UI
PAGE
AUTHENTICATION
BUSINESS
27. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Scenario: logging in
Given I am an internet user
When I navigate to http://www.facebook.com
And I click the field "username"
And I enter "boring@large.com"
And I click the field "password"
And I enter "correct horse battery staple"
And I click the button "Log In"
Then I see "What's on your mind" on the page
28. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Scenario: read my friends' updates
Given I am a logged in facebook user
When I look at my news feed
Then I should be able to read my
friends' updates
29. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Scenario: successful submission
Given I'm on the animal creation page
When I fill in Name with 'Alligator'
And select Phylum as 'Chordata'
And fill in Animal Class with 'Sauropsida'
And fill in Order with 'Crocodilia'
And fill in Family with 'Alligatoridae'
And fill in Genus with 'Alligator'
And check Lay Eggs
And click the Create button
Then I should see the notice 'Thank you for your animal
submission!'
And the page should include the animal's name, phylum,
animal class, order, family, and genus
30. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Scenario: successful submission
Given I'm on the animal creation page
When I add a new animal
Then I should see the page for my
newly created animal
And the notice 'Thank you for your
animal submission!'
32. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Scenario: read my friends' updates
Given I am a logged in facebook user
And there is another registered user
And that user is a friend of me
When I look at the other person's profile
Then I should be able to see his feed
33. BDD - Mikor jó?
www.meza.hu | @vsbmeza
Scenario: read my friends' updates
Given Fred is a logged in facebook user
And George is a registered facebook user
And George is a friend of Fred
When Fred looks at George's profile
Then Fred should be able to see George's feed
Ha ugy kezdodik, hogy TEST, az determinalja Ha should, az kerdojelezi. Formatter lecsereli testet shouldra amikor a camel caset felbontja JBehave -> JUnit Jbehave->Rbehave->Rspec->Cucumber Eric Evans - Domain Driven Design - Ubiquitous Language
Meg viccesebb eloado Business Analyst Dannel But that's just like analysis Given When Then Pushing Dan Thinking
Osszegzi a Dan es Chris gondolatait JBehave javat o irta Egyetlen igazan online is aktiv ember aki kotheto a BDD megalkotasahoz Stackoverflow huszar Eloado Tanar
Jbehave - tudjuk, hogy az volt az elso manifesztacio Rspec - Amive fajult a JBehave, es a rubysok sokasaga hasznalja Cucumber - A legelterjedtebb eddig. Behat - a phpsok asszociacioja TDD - Uncle Bob, Ron Jeffries AC - smmek, pok Simulating user interaction - Sokak szerint csak arra alkalmas
nem eszkozok. Az eszkoz csak eszkoz, semmi mas. Uncle Bobek hitevel elleneben Akkor lenne BDD a TDD, ha az egesz cegben mindenki programozo lenne. Az uzleti oldaltol kezdve az osszes erdekelten keresztul, mindenki. Akkor lehet TDDkent hasznalni. Van Dannek errol egy jo cikke
Konnyen megtalalhato pelda
Adott kontextusban elkovetett cselekmeny hatasara tortenik valami.
Mi tortenik, ha megvaltoztatjuk a kontextust? Mas lesz-e a kimenet? Vagy van-e olyan esemeny ami azonos kontextusban mas kimenetet eredmenyez?
Ez persze tok jo, ha csak be akartam menni a kocsmaba. De arrol nem arulkodik, hogy egyaltalan miert mentem be a kocsmaba...
Vegig se olvasom, annyira unalmas. A soros peldan legalabb kuncoghatunk
Az implementaciot koti meg Sokan alapbol igy gondolkodnak Problema: megkoti a fantaziat es az implementaciot. Determinal.
Deklarativ a mitre es a miertre ad valaszt Nem azt irja le, hogy hogyan. Igy, meg ha az implementacio valtozik is, az elerendo cel nem feltetlenul. Peldak: penztaros Vegye el tolem a sort Huzza le a csipogon Tegye be szatyorba Nyomja meg az entert a gepen Vegye el a penzt Adja vissza a visszajarot Adja ide a szamlat Adja ide a szatyrot vs. Megveszem a sort
Imperativ
Deklarativ
Imperativ
Imperativ / Deklarativ
Deklarativ
Az NLPben ismert ez a fogalom Konkret szavakat es kifejezeseket egyre magasabb absztrakcios szintre emelni Beulok a 1117 Budapest Neumann János utca 2. helyett Beulok a ZP-be helyett Beulok egy kocsmaba Erdemes felterkepezni a szovegben hasznalt temakoroket es a kozonseget, es olyan absztrakcios szintet valasztani, ami megfelelo.
se az autentikacio, se a navigacio, se a kattogas nem tartozik szorosan az uzleti ertekhez. Mi az ertek? A felhasznalo latja a baratainak a kiirasait.
Kommunikalja a celt, nem a megvalositast.
Rovidebb, erthetobb, kezelhetobb. Peldaul ha en most szomjazom: imperativ vs deklarativ
E/1 mukodik egyszeru esetben amikor nincs a userek kozott interakcio E/1 mukodik amikor nincsenek jogosultsagok
Ha itt neven nevezzuk a szereploket, akkor sokkal erthetobb kepet kapunk