1
How behavior-driven
development fuses
developers and testers
Bastian Seehaus, Baris Güldali
16.7.2015
2
Prelude
https://prezi.com/yon4j9tec8bd/deutschepostadress_and_s-labgermantestingday-part1/
3
Agenda
• What we use: BDD
• What we do: DSL using keywords
• How we do: Technologies for BDD
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
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
Agenda
• What we use: BDD
• What we do: DSL using keywords
• How we do: Technologies for BDD
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
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
Agenda
• What we use: BDD
• What we do: DSL using keywords
• How we do: Technologies for BDD
10
Technologies for BDD
11
JBehave for
[http://52.28.86.73]
12
Our prototype
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
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
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!

German Testing Day 2015 - How behavior-driven development fuses developers and testers

  • 1.
    1 How behavior-driven development fuses developersand testers Bastian Seehaus, Baris Güldali 16.7.2015
  • 2.
  • 3.
    3 Agenda • What weuse: 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 weuse: 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 weuse: BDD • What we do: DSL using keywords • How we do: Technologies for BDD
  • 10.
  • 11.
  • 12.
  • 13.
    13 Lessons Learned Summary • What weuse: 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 developmentfuses 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 – SoftwareQuality 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!