14. BDD
~ Behaviour Driven Development ~
“BDD facilitates agile development,
which is an approach to develop functional
software, within reasonable timeline, making
everyone happy, without killing anyone, or
burning down any bank.”
14
16. BDD's Core Principles
* It's all behaviour
“ The business & technology people
should be speaking the same words
when referring to the same idea,
there should not be any translator.”
16
17. BDD's Core Principles
* It's all behaviour
Behaviour: the addition of N values
should yield the summation of them
Example: the addition of 2 + 4 +1
should yield 8
17
18. BDD's Core Principles
* It's all behaviour
* Deliver stakeholder value
“ Whatever u are doing, it should be
delivering business value, or increasing
ur ability to deliver value, if the activity
doesn't acheive this, stop doing it”
18
19. BDD's Core Principles
* It's all behaviour
* Deliver stakeholder value
“ Unit testing is important, as it makes
refactoring & regression testing easier, which
eases maintenace and enhance ur ability to
deliver newer features faster”
19
20. BDD's Core Principles
* It's all behaviour
* Deliver stakeholder value
* Enough is enough
“ Do not overengineer, do not overdo
upfront planning, analysis and design.
Do just enough to get things started in the
right direction”
20
21. BDD's Core Principles
* It's all behaviour
* Deliver stakeholder value
* Enough is enough
“ When i wanna go to sentosa from my AMK
home, i just goto gothere.sg to do a quick
check, and that's good enough, i don't need
to get down to switching lanes on CTE,
blah blah. ” 21
23. Cucumber ? Nice to Eat ?!
* a tool for functional testing
23
24. Cucumber ? Nice to Eat ?!
* a tool for functional testing
* by Aslak HellesØy, & many other
nice people
24
25. Cucumber ? Nice to Eat ?!
* a tool for functional testing
* by Aslak HellesØy, & many other
nice people
* allows non-technies to express
app's functions in plain text
25
26. Cucumber ? Nice to Eat ?!
* a tool for functional testing
* by Aslak HellesØy, & many other
nice people
* allows non-technies to express
app's functions in plain text
* plain text serves as documentation
& executable examples
26
32. Guideline for the Narrative
* identify the stakeholder
“ Eg. The system administrator”
32
33. Guideline for the Narrative
* identify the stakeholder
* describe the feature he wants
“ Eg. Trashing of all invalid purchase
orders in the system”
33
34. Guideline for the Narrative
* identify the stakeholder
* describe the feature he wants
* the reason for wanting it
“ Eg. Prevent data corruption”
34
39. Given | When | Then
* GIVEN ... setting up system to a
known state
“ Eg 1. Database setup ...
Given the following users already exists”
“ Eg 2. Visiting a Url ...
Given I am on users management page”
“ Eg 3. Ensure User's Login ...
Given I already login as “HappyMan””
39
40. Given | When | Then
* GIVEN ... setting up system to a
known state
* WHEN ... exercising an event
“ Eg. Pressing Button ...
When I press “Help Me””
40
41. Given | When | Then
* GIVEN ... setting up system to a
known state
* WHEN ... exercising an event
* THEN ... verifying an outcome
“ Eg. Seeing a message ...
Then I should see “Login Successful””
41
42. Save & Execute It !!
* Save at:
<PROJECT_ROOT>
`~ features/
`- sign_up.feature
42
43. Save & Execute It !!
* Save at:
<PROJECT_ROOT>
`~ features/
`- sign_up.feature
* Run with:
#$ cucumber features
43