Upload
bastian-seehaus
View
59
Download
1
Tags:
Embed Size (px)
Citation preview
1
How behavior-driven
development fuses
developers and testers
Bastian Seehaus, Baris Güldali
16.7.2015
2
Prelude
2
https://prezi.com/yon4j9tec8bd/deutschepostadress_and_s-labgermantestingday-part1/
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
[Ra
ch
el D
avie
s: B
DD
in
a N
uts
he
ll]
“BDD = Shared understanding by discussing examples”
tests
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/
7
DSL using keywords
7
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
DSL using keywords
8
• 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
11
JBehave for
[http://52.28.86.73]
12
Our prototype
12
Ticket::
User Story
Ticket::
Scenario
+subtask
Script/Plugin
CustomField::
BDD Editor
+fields
Atlassian-API
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
13
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
14
Keyword catalogue
15
s-lab – Software Quality Lab
University of Paderborn
Zukunftsmeile 1
33102 Paderborn
Tel.: +49 5251 60 5392
http://s-lab.upb.de
Thank you for your
attention.
15
Thank you for your attention!