This document discusses how behavior-driven development (BDD) fuses developers and testers by:
1. Having business analysts write test cases using natural language and keywords like Given, When, Then in a domain-specific language (DSL).
2. Shifting test activities so that business analysts write test cases and testers and developers enable test execution using technologies like JIRA, Confluence, Robot Framework, and JBehave.
3. Highlighting the importance of defining and maintaining a keyword catalogue to increase acceptance and requiring discipline.
3. 3
Agenda
• What we use: BDD
• What we do: DSL using keywords
• How we do: Technologies for BDD
4. 4
Developer
Scenario
Given …
When …
Then …
Scenario
Given …
When …
Then …
Behavior-Driven Development
User Story
As a role
I want to use a function
so that I achieve a goal
Scenario
Given some initial context,
When an event occurs,
Then ensure some outcomes.
Product owner
Business analyst Tester
[RachelDavies:BDDinaNutshell]
“BDD = Shared understanding by discussing examples”
tests
5. 5
BDD example
User Story: Customer withdraws cash
As a customer,
I want to withdraw cash from an ATM,
so that I don’t have to wait in line at the bank.
Scenario 1: Account is in credit
Given the account is in credit
And the card is valid
When the customer requests cash
Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned
Scenario 2: Account is overdrawn
Given the account is overdrawn
And the card is valid
When the customer requests cash
Then ensure a rejection message is displayed
And ensure cash is not dispensed
And ensure the card is returned
readable
@Given(“the account is overdrawn”)
public bool accountIsOverdrawn(){
...
}
@Given(“the card is valid”)
public bool cardIsValid(){
...
}
@When(“the customer requests cash”)
public void customerRequestsCash() {
...
}
executable
http://dannorth.net/introducing-bdd/
6. 6
Agenda
• What we use: BDD
• What we do: DSL using keywords
• How we do: Technologies for BDD
7. 7
DSL using keywords
Scenario
Given …
When …
Then …
Scenario
Given …
When …
Then …
User Story
As a …
I want to …
so that ....
Scenario
Given …
When …
Then …
Keyword catalogue
tests
uses
frontend
keywords
backend
keywords
• GUI interactions
• Navigation actions
• Business pre and
post conditions
• Service invocations
• Database actions
• Command line
actions
• Technical pre and
post conditions
Product owner Business analyst
Tester Developer
8. 8
DSL using keywords
• GUI interactions
• Navigation actions
• Business pre and
post conditions
Product owner Business analyst
• Service invocations
• Database actions
• Command line
actions
• Technical pre and
post conditions
Tester Developer
9. 9
Agenda
• What we use: BDD
• What we do: DSL using keywords
• How we do: Technologies for BDD
13. 13
Lessons
Learned
Summary
• What we use: BDD
– for early test specification
– using natural language
– imminent test execution
• What we do: DSL using keywords
– frontend keywords
– backend keywords
• How we do: Technologies for BDD
– test specification: Confluence & JIRA
– test execution: Robot Framework & JBehave
14. 14
“How behavior-driven development fuses developers and testers?”
Lessons Learned
• Test activities shifted
– Business analyst writes test cases
– Testers and developers enable test execution
• Defining and maintaining a keyword catalogue …
– is of great importance
– requires high level of discipline
• Tools, tools, tools …
– User friendly editors increase the acceptance
– Scripting for tool integration
Keyword catalogue
15. 15
s-lab – Software Quality Lab
University of Paderborn
Zukunftsmeile 1
33102 Paderborn
Tel.: +49 5251 60 5392
http://s-lab.upb.de
bguldali@s-lab.upb.de
Thank you for your
attention.
Thank you for your attention!