SlideShare a Scribd company logo
1 of 74
Download to read offline
@yashaka
Don’t be fooled with BDD,
automation engineer;)
@yashaka
Don’t be fooled with BDD,
automation engineer;)
@yashaka
seleniumcourses.com
About
Don’t be fooled by BDD
Reasoned by:
Q&A from BBDD talk
http://seleniumcamp.com/talk/better-bullshit-driven-development/
Don’t be fooled by BDD
Inspired by:
D. Zharii comment at “TDD vs BDD: what the difference?” (ru, en)
Dan North’s “Introducing BDD”, March 2006 (en)
Dan North’s “Introducing RBehave”, June 2007 (en)
Dan North’s “BDD is like TDD if”, May 2012 (en)
Liz Keogh’s “Translating TDD to BDD”, November 2009 (en)
Liz Keogh’s “Showcasing the language of BDD”, May 2012 (en)
Wiki’s “Behaviour-driven development” (en)
yashaka's:) experience of fighting with customers about using BDD at incorrect scopes :)
Plan
Preface: BDD?
BDD History
Cucumber-like BDD tools
“xUnit restyled to BDD” tools
xUnit tools styled as BDD
Summary
Q&A
Plan
Preface: BDD?
BDD History
Cucumber-like BDD tools
“xUnit restyled to BDD” tools
xUnit tools styled as BDD
Summary
Q&A
now
past
Tools retrospective
BDD?
Trump cards on the table
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
?
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is outside-in
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
BDD is outside-in
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
any mention about
Automation Engineers?
BDD is outside-in
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
any mention about
Automation Engineers?
so why do
“hammering nails with a microscope”?
Q&A
BDD History
Once upon a time… one TDD coach…
faced problems in his trainings…
Dan North: “Introducing BDD”, March 2006
“Programmers wanted to know where to start, what to test and what not to test, how
much to test in one go, what to call their tests, and how to understand why a test
fails.” (c)
So he thought about…
“Test method names should be sentences” (c)
giving at least
some docs to devs
public class DiasporaBoardComponentTest {



...

public void testSharesMessage() {

...

}

}
Dan North: “Introducing BDD”, March 2006
So he thought about…
“Test method names should be sentences” (c)
giving at least
some docs to devs
public class DiasporaBoardComponentTest {



...

public void testSharesMessage() {

...

}

}
Dan North: “Introducing BDD”, March 2006
side note: examples were prepared in the “acceptance” context
instead of the “unit” context, as in the original article…
So he thought about…
“Test method names should be sentences” (c)
giving at least
some docs to devs
public class DiasporaBoardComponentTest {



...

public void testSharesMessage() {

...

}

}
Dan North: “Introducing BDD”, March 2006
So he thought about…
…in the language of the business domain
so starts to make more sense to other stakeholders (BA, Test E.)
Dan North: “Introducing BDD”, March 2006
public class DiasporaStreamTest {



...

public void testSharesPost() {

...

}

}
So he thought about…
…with “should” instead of “test”
so starts to make more sense to other stakeholders (BA, Test E.)
Dan North: “Introducing BDD”, March 2006
public class DiasporaStreamTest { 



...

public void shouldSharePost() {

...

}

}
So he thought about…
…with “should” instead of “test”
“… implicitly allows … to challenge …: “Should it? Really?” .. easier to decide whether a
test is failing due to a bug … or … because … previous assumptions about … behaviour
are now incorrect.” (c)
Dan North: “Introducing BDD”, March 2006
public class DiasporaStreamTest { 



...

public void shouldSharePost() {

...

}

}
So he thought about…
…“Behaviour” is a more useful word than “test” (c)
Dan North: “Introducing BDD”, March 2006
TBDD = TestBehaviour-driven development
So he thought about…
…creating tools to help "to be in behaviour context”
Dan North: “Introducing BDD”, March 2006
early: JBehave, RBehave (then “was merged” to RSpec)
late: Cucumber, etc.
So he thought about…
…creating tools to help "to be in behaviour context"
Ruby + RSpec example
describe 'Diaspora stream' do



it 'should share post' do

...

end

end
Dan North: “Introducing BDD”, March 2006
So he thought about…
focus on business value...
"What’s the next most important thing the system doesn’t do?" (c)
describe 'Diaspora stream' do



it 'should share post' do

...

end



it 'should delete post' do

# to be implemented

end


end
Dan North: “Introducing BDD”, March 2006
So he thought about…
share all this stuff with BA, testers... that's actually same thing - specifications
describe 'Diaspora stream' do



it 'should share post'
it 'should edit post'
it 'should hide post'

it 'should delete post'
...


end
Dan North: “Introducing BDD”, March 2006
So he thought about…
(being inspired by domain-driven design ideas)
define "ubiquitous language" for the "analysis" itself
Dan North: “Introducing BDD”, March 2006
As a [X] I want [Y] so that [Z]
Given some initial context (the givens),
When an event occurs,
then ensure some outcomes.
So he thought about…
(being inspired by domain-driven design ideas)
define "ubiquitous language" for the "analysis" itself
Dan North: “Introducing BDD”, March 2006
As a [X] I want [Y] so that [Z]
Given some initial context (the givens),
When an event occurs,
then ensure some outcomes.
where (c)
Y is some feature,
Z is the benefit or value of the feature,
and X is the person (or role) who will benefit.

So he thought about…
(being inspired by domain-driven design ideas)
define "ubiquitous language" for the "analysis" itself
Dan North: “Introducing BDD”, March 2006
As a [X] I want [Y] so that [Z]
Given some initial context (the givens),
When an event occurs,
then ensure some outcomes.
So he thought about…
Acceptance criteria should be executable (c)
Dan North: “Introducing BDD”, March 2006
Ruby + early RBehave example
Dan North: “Introducing RBehave”, June 2007
Story 'share post',
%(As a diaspora user
I want to share post to the stream
So that I keep my subscribers updated with all my news) do
Scenario 'new post can be added to user stream' do
Given 'user logged in with credentials:', 'yashaka', 'secret'
When 'shared new post:', 'will give a talk about BDD today'
Then 'user stream should be updated with a new top post:', 'will give a
talk about BDD today'
end
Scenario 'subscriber stream is updated with the new user post'
...
end
Story 'share post',
%(As a diaspora user
I want to share post to the stream
So that I keep my subscribers updated with all my news) do
Scenario 'new post can be added to user stream' do
Given 'user logged with credentials:', 'yashaka', 'secret' do |user, passw|
diaspora.login_page.open().sign_in(user, passw)
end
When 'shared new post:', 'will give a talk about BDD today' do |message|
diaspora.stream.new_post.start().write(message).share()
end
Then 'user stream should be updated with a new top post:', 'will give a talk
about BDD today' do |message|
diaspora.stream.post(0).should_be(message)
end
end
Scenario 'subscriber stream is updated with the new user post' do
...
end
end
Ruby + early RBehave example
Finally he invented…
Dan North: “Introducing BDD”, March 2006
Dan North: "How to sell BDD to the business", November 2009:
"BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-
scale, high-automation, agile methodology. It describes a cycle of interactions with
well-defined outputs, resulting in the delivery of working, tested software that
matters." (c)
Remember? outside-in BDD
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
any mention about
Automation Engineers?
Remember? outside-in BDD
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
any mention about
Automation Engineers?
notice emphasising BA terminology?
Remember? outside-in BDD
TDD
tests first
written by devs
with tests
as documentation
as behaviours
focused on business
as specification
i.e. provided from BA side
a tool to define unclear reqs
in ubiquitous language
discussed between all stakeholders
(BA, Test, Dev, etc.)
any mention about
Automation Engineers?
notice emphasising BA terminology?
moreover, BDD is NOT about Testing!
Testing...
Wiki's "Software Testing"
"Software testing is an investigation conducted to provide stakeholders with
information about the quality of the product or service under test." (c)
BDD...
is about "investigation conducted by stakeholders to figure out what the product
SHOULD be" (c)
Liz Keogh’s “Showcasing the language of BDD”, May 2012
Testing...
"we assume that we don’t know what we’re doing (and probably don’t know that we
don’t know)" (c)
Liz Keogh’s “Showcasing the language of BDD”, May 2012
BDD...
"imply that you know what you’re doing and just want to make sure you’ve done it" (c)
So...
1. BDD starts earlier than Testing Product can even become possible…
2. BDD is completely not about "Automating Regression by testers/automation
engineers". Because once we already have implementation - we missed the train.
There are no more of those main problems that BDD was created to solve.
Given the train is missed

When trying to catch the train with automation coverage
And as usual lacking time
Then why to use BDD tools –
often heavy frameworks
tuned for BA that is already not relevant ?
Tools Retrospective
Cucumber-like tools
Cucumber-jvm
@defaults

Feature: Diaspora



Scenario: Share message

Given I signed in from login page with credentials: 'yashaka', 'secret'

When I publish new post: 'will give a BDD talk today'

Then I should see new post 'will give a BDD talk today' in the top of
stream
Cucumber-jvm
public class DiasporaStepdefs {

LoginPage loginPage = new LoginPage();

NewPost newPost = new NewPost();

Stream stream = new Stream();



@Given("^I signed in from login page with credentials: '(.+)', '(.+)'$")

public void
I_signed_in_from_login_page_with_credentials_selenide_yagniyagni(String
username, String password) {

loginPage.open();

loginPage.signIn(username, password);

}
...
Cucumber-jvm
...
@When("^I publish new post: '(.+)'$")

public void I_publish_new_post_Selenide_is_released_(String text) {

newPost.start();

newPost.write(text);

newPost.share();

}



@Then("^I should see new post '(.+)' in the top of stream$")

public void
I_should_see_new_post_Selenide_is_released_in_the_top_of_stream(String text)
{

stream.shouldHavePostWithText(0, text);

}

}
xUnit "restyled to BDD" tools
Spock + Fluent PageObject + Allure @steps + One Entry Point
public class DiasporaStreamTest extends Specification {



def "should share post"() {

given: "user logged in"
app.loginPage().open().signIn("yashaka","secret")

when: "shared new post"
app.newPost().start().write("will give a BDD talk today").share()

then: "new post should appear in the top of the stream"
app.stream().post(0).shouldBe("will give a BDD talk today")

}

}
Spock + Fluent PageObject + Allure @steps + One Entry Point
public class DiasporaStreamTest extends Specification {



def "should share post"() {

given:
app.loginPage().open().signIn("yashaka","secret")

when:
app.newPost().start().write("will give a BDD talk today").share()

then:
app.stream().post(0).shouldBe("will give a BDD talk today")

}

}
or even simpler if desired
xUnit tools "styled to BDD"
JUnit + Fluent PageObject + Allure @steps + Gherkined One Entry Point
public class DiasporaStreamTest extends GherkinTest {



@Test

public void shouldSharePost() {

GIVEN("user logged in")
.loginPage().open().signIn("yashaka","secret");

WHEN("shared new post")
.newPost().start().write("will give a BDD talk today").share();

THEN("new post should appear in the top of the stream")
.stream().post(0).shouldBe("will give a BDD talk today");

}

}
JUnit + Fluent PageObject + Allure @steps + Gherkined One Entry Point
public class DiasporaStreamTest extends GherkinTest {



@Test

public void shouldSharePost() {

GIVEN().loginPage().open().signIn("yashaka","secret");

WHEN().newPost().start().write("will give a BDD talk today").share();

THEN().stream().post(0).shouldBe("will give a BDD talk today");

}

}
or even simpler if desired
Summary
GIVEN no outside-in:
no BA writing Gherkin
AND no Devs writing tests before implementation
AND automation engineers writing tests after
WHEN
xUnit + static Java
AND Fluent PageObjects with Allure readable @Steps
AND Gherkin style of One Entry Point (aka Application Manager)
THEN
"not BA" pros of BDD can be achieved much easier and faster
Summary
GIVEN no outside-in:
no BA writing Gherkin
AND no Devs writing tests before implementation
AND automation engineers writing tests after
WHEN
xUnit + static Java
AND Fluent PageObjects with Allure readable @Steps
AND Gherkin style of One Entry Point (aka Application Manager)
THEN
"not BA" pros of BDD can be achieved much easier and faster
KISS: classic static Java
and simple yet powerful Junit/TestNg (parallelisation, etc.)
need additional Gherkin support
but impl is few simple no-magic lines of code
with ability to match fluently the one entry point
Summary
GIVEN no outside-in:
no BA writing Gherkin
AND no Devs writing tests before implementation
AND automation engineers writing tests after
WHEN
Spock + dynamic Groovy
AND Fluent PageObjects with Allure readable @Steps
AND One Entry Point (aka Application Manager)
THEN
"not BA" pros of BDD can be achieved much easier and faster
Summary
GIVEN no outside-in:
no BA writing Gherkin
AND no Devs writing tests before implementation
AND automation engineers writing tests after
WHEN
Spock + dynamic Groovy
AND Fluent PageObjects with Allure readable @Steps
AND One Entry Point (aka Application Manager)
THEN
"not BA" pros of BDD can be achieved much easier and faster
for some newcomers – too dynamic => prone to hardly debuggable errors
but less "fluent"
less parallel tests support
test names as strings with spaces
out of the box gherkin
pseudo-BDD with
xUnit/Spock, Fluent PageObjects, Allure @Steps, “Gherkined" One Entry Point
• all-powerful programming language over textual-pseudo-language
• full IDE support (autocompletion, auto-generate, etc.)
• 1 abstraction layer less => simpler and faster in implementation
• still fully readable and with pretty good reports
• newcomers friendly
• Just One Entry Point to all Application Model
• structured with granular Fluent PageObjects => easier to learn&use via
autocompletion
Plan?
Preface: BDD?
BDD History
Cucumber-like BDD tools
“xUnit restyled to BDD” tools
xUnit tools styled as BDD
Summary
Q&A
now
past
Tools retrospective
Future?
Plan?
Preface: BDD?
BDD History
Cucumber-like BDD tools
“xUnit restyled to BDD” tools
xUnit tools styled as BDD
Summary
Q&A
now
past
Tools retrospective
Future?
Plan?
Preface: BDD?
BDD History
Cucumber-like BDD tools
“xUnit restyled to BDD” tools
xUnit tools styled as BDD
Summary
Q&A
now
past
Tools retrospective
Future?
with improved UX
Plan?
Preface: BDD?
BDD History
Cucumber-like BDD tools
“xUnit restyled to BDD” tools
xUnit tools styled as BDD
Summary
Q&A
now
past
Tools retrospective
Future?
X tool
Afterwords
There are good practices in context,
but there are no best practices.
(c) Cem Kaner, James Bach
Q&A
Thank you!
github.com/automician
automician.com
seleniumcourses.com
yashaka @
@yashaka
You are welcome;)
Selene in Python
NSelene in C#
Selenide snippets in Java
Yashaka talks src code
Selenide User Guide
@yashaka
We are looking for talents
automician@gmail.com

More Related Content

Similar to Dont be fooled with BDD, automation engineer! ;)

Behaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational ApplicationsBehaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational ApplicationsFlorian Georg
 
Cucumber And Bdd
Cucumber And BddCucumber And Bdd
Cucumber And Bddjoshcrews
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?devObjective
 
Behavior Driven Development: An Overview
Behavior Driven Development:  An OverviewBehavior Driven Development:  An Overview
Behavior Driven Development: An Overviewbmaynard_at_litle
 
Jumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppJumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppMongoDB
 
Mongodbworkshop I: get started
Mongodbworkshop I: get startedMongodbworkshop I: get started
Mongodbworkshop I: get startedVivian S. Zhang
 
Introjs10.5.17SD
Introjs10.5.17SDIntrojs10.5.17SD
Introjs10.5.17SDThinkful
 
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScriptJS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScriptJSFestUA
 
DockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by TianonDockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by TianonDocker, Inc.
 
How To Contribute Drupalcon
How To Contribute   DrupalconHow To Contribute   Drupalcon
How To Contribute Drupalconguestc9344e
 
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...MongoDB
 
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDBMongoDB
 
Binderoo - A rapid iteration framework that even scripters can use
Binderoo -  A rapid iteration framework that even scripters can useBinderoo -  A rapid iteration framework that even scripters can use
Binderoo - A rapid iteration framework that even scripters can useEthan Watson
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?ColdFusionConference
 

Similar to Dont be fooled with BDD, automation engineer! ;) (20)

50 Ways To Love Your Project
50 Ways To Love Your Project50 Ways To Love Your Project
50 Ways To Love Your Project
 
Behaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational ApplicationsBehaviour-Driven Development for Conversational Applications
Behaviour-Driven Development for Conversational Applications
 
Cucumber And Bdd
Cucumber And BddCucumber And Bdd
Cucumber And Bdd
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Behavior Driven Development: An Overview
Behavior Driven Development:  An OverviewBehavior Driven Development:  An Overview
Behavior Driven Development: An Overview
 
Jumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB AppJumpstart: Building Your First MongoDB App
Jumpstart: Building Your First MongoDB App
 
Mongodbworkshop I: get started
Mongodbworkshop I: get startedMongodbworkshop I: get started
Mongodbworkshop I: get started
 
MongoDB Workshop
MongoDB WorkshopMongoDB Workshop
MongoDB Workshop
 
Introjs10.5.17SD
Introjs10.5.17SDIntrojs10.5.17SD
Introjs10.5.17SD
 
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScriptJS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
JS Fest 2019. Ryan Dahl. Deno, a new way to JavaScript
 
DockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by TianonDockerCon14 Contributing to Docker by Tianon
DockerCon14 Contributing to Docker by Tianon
 
How To Contribute Drupalcon
How To Contribute   DrupalconHow To Contribute   Drupalcon
How To Contribute Drupalcon
 
Semweb at the BBC
Semweb at the BBCSemweb at the BBC
Semweb at the BBC
 
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
Big Data Analytics 3: Machine Learning to Engage the Customer, with Apache Sp...
 
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB GalaxyMongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
MongoDB World 2019: Don't Panic - The Hitchhiker's Guide to the MongoDB Galaxy
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Binderoo - A rapid iteration framework that even scripters can use
Binderoo -  A rapid iteration framework that even scripters can useBinderoo -  A rapid iteration framework that even scripters can use
Binderoo - A rapid iteration framework that even scripters can use
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 

More from Iakiv Kramarenko

Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide»
Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide» Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide»
Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide» Iakiv Kramarenko
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Iakiv Kramarenko
 
Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybaraIakiv Kramarenko
 
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...Iakiv Kramarenko
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Iakiv Kramarenko
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - ENIakiv Kramarenko
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Iakiv Kramarenko
 
Write Selenide in Python 15 min
Write Selenide in Python 15 minWrite Selenide in Python 15 min
Write Selenide in Python 15 minIakiv Kramarenko
 
Automation is Easy! (python version)
Automation is Easy! (python version)Automation is Easy! (python version)
Automation is Easy! (python version)Iakiv Kramarenko
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Iakiv Kramarenko
 

More from Iakiv Kramarenko (12)

Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide»
Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide» Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide»
Отзывы на раннюю версию курса «Искусство Автоматизации с Java + Selenide»
 
Easy automation.py
Easy automation.pyEasy automation.py
Easy automation.py
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]
 
KISS Automation.py
KISS Automation.pyKISS Automation.py
KISS Automation.py
 
Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybara
 
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - EN
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
 
Write Selenide in Python 15 min
Write Selenide in Python 15 minWrite Selenide in Python 15 min
Write Selenide in Python 15 min
 
Automation is Easy! (python version)
Automation is Easy! (python version)Automation is Easy! (python version)
Automation is Easy! (python version)
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 

Recently uploaded

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Dont be fooled with BDD, automation engineer! ;)

  • 1. @yashaka Don’t be fooled with BDD, automation engineer;)
  • 2. @yashaka Don’t be fooled with BDD, automation engineer;)
  • 4. Don’t be fooled by BDD Reasoned by: Q&A from BBDD talk http://seleniumcamp.com/talk/better-bullshit-driven-development/
  • 5. Don’t be fooled by BDD Inspired by: D. Zharii comment at “TDD vs BDD: what the difference?” (ru, en) Dan North’s “Introducing BDD”, March 2006 (en) Dan North’s “Introducing RBehave”, June 2007 (en) Dan North’s “BDD is like TDD if”, May 2012 (en) Liz Keogh’s “Translating TDD to BDD”, November 2009 (en) Liz Keogh’s “Showcasing the language of BDD”, May 2012 (en) Wiki’s “Behaviour-driven development” (en) yashaka's:) experience of fighting with customers about using BDD at incorrect scopes :)
  • 6. Plan Preface: BDD? BDD History Cucumber-like BDD tools “xUnit restyled to BDD” tools xUnit tools styled as BDD Summary Q&A
  • 7. Plan Preface: BDD? BDD History Cucumber-like BDD tools “xUnit restyled to BDD” tools xUnit tools styled as BDD Summary Q&A now past Tools retrospective
  • 9. Trump cards on the table
  • 10. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.) ?
  • 11. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 12. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 13. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 14. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 15. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 16. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 17. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 18. BDD is TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 19. BDD is outside-in TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.)
  • 20. BDD is outside-in TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.) any mention about Automation Engineers?
  • 21. BDD is outside-in TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.) any mention about Automation Engineers? so why do “hammering nails with a microscope”?
  • 22. Q&A
  • 24. Once upon a time… one TDD coach… faced problems in his trainings… Dan North: “Introducing BDD”, March 2006 “Programmers wanted to know where to start, what to test and what not to test, how much to test in one go, what to call their tests, and how to understand why a test fails.” (c)
  • 25. So he thought about… “Test method names should be sentences” (c) giving at least some docs to devs public class DiasporaBoardComponentTest {
 
 ...
 public void testSharesMessage() {
 ...
 }
 } Dan North: “Introducing BDD”, March 2006
  • 26. So he thought about… “Test method names should be sentences” (c) giving at least some docs to devs public class DiasporaBoardComponentTest {
 
 ...
 public void testSharesMessage() {
 ...
 }
 } Dan North: “Introducing BDD”, March 2006 side note: examples were prepared in the “acceptance” context instead of the “unit” context, as in the original article…
  • 27. So he thought about… “Test method names should be sentences” (c) giving at least some docs to devs public class DiasporaBoardComponentTest {
 
 ...
 public void testSharesMessage() {
 ...
 }
 } Dan North: “Introducing BDD”, March 2006
  • 28. So he thought about… …in the language of the business domain so starts to make more sense to other stakeholders (BA, Test E.) Dan North: “Introducing BDD”, March 2006 public class DiasporaStreamTest {
 
 ...
 public void testSharesPost() {
 ...
 }
 }
  • 29. So he thought about… …with “should” instead of “test” so starts to make more sense to other stakeholders (BA, Test E.) Dan North: “Introducing BDD”, March 2006 public class DiasporaStreamTest { 
 
 ...
 public void shouldSharePost() {
 ...
 }
 }
  • 30. So he thought about… …with “should” instead of “test” “… implicitly allows … to challenge …: “Should it? Really?” .. easier to decide whether a test is failing due to a bug … or … because … previous assumptions about … behaviour are now incorrect.” (c) Dan North: “Introducing BDD”, March 2006 public class DiasporaStreamTest { 
 
 ...
 public void shouldSharePost() {
 ...
 }
 }
  • 31. So he thought about… …“Behaviour” is a more useful word than “test” (c) Dan North: “Introducing BDD”, March 2006 TBDD = TestBehaviour-driven development
  • 32. So he thought about… …creating tools to help "to be in behaviour context” Dan North: “Introducing BDD”, March 2006 early: JBehave, RBehave (then “was merged” to RSpec) late: Cucumber, etc.
  • 33. So he thought about… …creating tools to help "to be in behaviour context" Ruby + RSpec example describe 'Diaspora stream' do
 
 it 'should share post' do
 ...
 end
 end Dan North: “Introducing BDD”, March 2006
  • 34. So he thought about… focus on business value... "What’s the next most important thing the system doesn’t do?" (c) describe 'Diaspora stream' do
 
 it 'should share post' do
 ...
 end
 
 it 'should delete post' do
 # to be implemented
 end 
 end Dan North: “Introducing BDD”, March 2006
  • 35. So he thought about… share all this stuff with BA, testers... that's actually same thing - specifications describe 'Diaspora stream' do
 
 it 'should share post' it 'should edit post' it 'should hide post'
 it 'should delete post' ... 
 end Dan North: “Introducing BDD”, March 2006
  • 36. So he thought about… (being inspired by domain-driven design ideas) define "ubiquitous language" for the "analysis" itself Dan North: “Introducing BDD”, March 2006 As a [X] I want [Y] so that [Z] Given some initial context (the givens), When an event occurs, then ensure some outcomes.
  • 37. So he thought about… (being inspired by domain-driven design ideas) define "ubiquitous language" for the "analysis" itself Dan North: “Introducing BDD”, March 2006 As a [X] I want [Y] so that [Z] Given some initial context (the givens), When an event occurs, then ensure some outcomes. where (c) Y is some feature, Z is the benefit or value of the feature, and X is the person (or role) who will benefit.

  • 38. So he thought about… (being inspired by domain-driven design ideas) define "ubiquitous language" for the "analysis" itself Dan North: “Introducing BDD”, March 2006 As a [X] I want [Y] so that [Z] Given some initial context (the givens), When an event occurs, then ensure some outcomes.
  • 39. So he thought about… Acceptance criteria should be executable (c) Dan North: “Introducing BDD”, March 2006 Ruby + early RBehave example Dan North: “Introducing RBehave”, June 2007 Story 'share post', %(As a diaspora user I want to share post to the stream So that I keep my subscribers updated with all my news) do Scenario 'new post can be added to user stream' do Given 'user logged in with credentials:', 'yashaka', 'secret' When 'shared new post:', 'will give a talk about BDD today' Then 'user stream should be updated with a new top post:', 'will give a talk about BDD today' end Scenario 'subscriber stream is updated with the new user post' ... end
  • 40. Story 'share post', %(As a diaspora user I want to share post to the stream So that I keep my subscribers updated with all my news) do Scenario 'new post can be added to user stream' do Given 'user logged with credentials:', 'yashaka', 'secret' do |user, passw| diaspora.login_page.open().sign_in(user, passw) end When 'shared new post:', 'will give a talk about BDD today' do |message| diaspora.stream.new_post.start().write(message).share() end Then 'user stream should be updated with a new top post:', 'will give a talk about BDD today' do |message| diaspora.stream.post(0).should_be(message) end end Scenario 'subscriber stream is updated with the new user post' do ... end end Ruby + early RBehave example
  • 41. Finally he invented… Dan North: “Introducing BDD”, March 2006 Dan North: "How to sell BDD to the business", November 2009: "BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple- scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters." (c)
  • 42. Remember? outside-in BDD TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.) any mention about Automation Engineers?
  • 43. Remember? outside-in BDD TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.) any mention about Automation Engineers? notice emphasising BA terminology?
  • 44. Remember? outside-in BDD TDD tests first written by devs with tests as documentation as behaviours focused on business as specification i.e. provided from BA side a tool to define unclear reqs in ubiquitous language discussed between all stakeholders (BA, Test, Dev, etc.) any mention about Automation Engineers? notice emphasising BA terminology? moreover, BDD is NOT about Testing!
  • 45. Testing... Wiki's "Software Testing" "Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test." (c)
  • 46. BDD... is about "investigation conducted by stakeholders to figure out what the product SHOULD be" (c) Liz Keogh’s “Showcasing the language of BDD”, May 2012
  • 47. Testing... "we assume that we don’t know what we’re doing (and probably don’t know that we don’t know)" (c) Liz Keogh’s “Showcasing the language of BDD”, May 2012 BDD... "imply that you know what you’re doing and just want to make sure you’ve done it" (c)
  • 48. So... 1. BDD starts earlier than Testing Product can even become possible… 2. BDD is completely not about "Automating Regression by testers/automation engineers". Because once we already have implementation - we missed the train. There are no more of those main problems that BDD was created to solve.
  • 49. Given the train is missed
 When trying to catch the train with automation coverage And as usual lacking time Then why to use BDD tools – often heavy frameworks tuned for BA that is already not relevant ?
  • 52. Cucumber-jvm @defaults
 Feature: Diaspora
 
 Scenario: Share message
 Given I signed in from login page with credentials: 'yashaka', 'secret'
 When I publish new post: 'will give a BDD talk today'
 Then I should see new post 'will give a BDD talk today' in the top of stream
  • 53. Cucumber-jvm public class DiasporaStepdefs {
 LoginPage loginPage = new LoginPage();
 NewPost newPost = new NewPost();
 Stream stream = new Stream();
 
 @Given("^I signed in from login page with credentials: '(.+)', '(.+)'$")
 public void I_signed_in_from_login_page_with_credentials_selenide_yagniyagni(String username, String password) {
 loginPage.open();
 loginPage.signIn(username, password);
 } ...
  • 54. Cucumber-jvm ... @When("^I publish new post: '(.+)'$")
 public void I_publish_new_post_Selenide_is_released_(String text) {
 newPost.start();
 newPost.write(text);
 newPost.share();
 }
 
 @Then("^I should see new post '(.+)' in the top of stream$")
 public void I_should_see_new_post_Selenide_is_released_in_the_top_of_stream(String text) {
 stream.shouldHavePostWithText(0, text);
 }
 }
  • 55. xUnit "restyled to BDD" tools
  • 56. Spock + Fluent PageObject + Allure @steps + One Entry Point public class DiasporaStreamTest extends Specification {
 
 def "should share post"() {
 given: "user logged in" app.loginPage().open().signIn("yashaka","secret")
 when: "shared new post" app.newPost().start().write("will give a BDD talk today").share()
 then: "new post should appear in the top of the stream" app.stream().post(0).shouldBe("will give a BDD talk today")
 }
 }
  • 57. Spock + Fluent PageObject + Allure @steps + One Entry Point public class DiasporaStreamTest extends Specification {
 
 def "should share post"() {
 given: app.loginPage().open().signIn("yashaka","secret")
 when: app.newPost().start().write("will give a BDD talk today").share()
 then: app.stream().post(0).shouldBe("will give a BDD talk today")
 }
 } or even simpler if desired
  • 59. JUnit + Fluent PageObject + Allure @steps + Gherkined One Entry Point public class DiasporaStreamTest extends GherkinTest {
 
 @Test
 public void shouldSharePost() {
 GIVEN("user logged in") .loginPage().open().signIn("yashaka","secret");
 WHEN("shared new post") .newPost().start().write("will give a BDD talk today").share();
 THEN("new post should appear in the top of the stream") .stream().post(0).shouldBe("will give a BDD talk today");
 }
 }
  • 60. JUnit + Fluent PageObject + Allure @steps + Gherkined One Entry Point public class DiasporaStreamTest extends GherkinTest {
 
 @Test
 public void shouldSharePost() {
 GIVEN().loginPage().open().signIn("yashaka","secret");
 WHEN().newPost().start().write("will give a BDD talk today").share();
 THEN().stream().post(0).shouldBe("will give a BDD talk today");
 }
 } or even simpler if desired
  • 61. Summary GIVEN no outside-in: no BA writing Gherkin AND no Devs writing tests before implementation AND automation engineers writing tests after WHEN xUnit + static Java AND Fluent PageObjects with Allure readable @Steps AND Gherkin style of One Entry Point (aka Application Manager) THEN "not BA" pros of BDD can be achieved much easier and faster
  • 62. Summary GIVEN no outside-in: no BA writing Gherkin AND no Devs writing tests before implementation AND automation engineers writing tests after WHEN xUnit + static Java AND Fluent PageObjects with Allure readable @Steps AND Gherkin style of One Entry Point (aka Application Manager) THEN "not BA" pros of BDD can be achieved much easier and faster KISS: classic static Java and simple yet powerful Junit/TestNg (parallelisation, etc.) need additional Gherkin support but impl is few simple no-magic lines of code with ability to match fluently the one entry point
  • 63. Summary GIVEN no outside-in: no BA writing Gherkin AND no Devs writing tests before implementation AND automation engineers writing tests after WHEN Spock + dynamic Groovy AND Fluent PageObjects with Allure readable @Steps AND One Entry Point (aka Application Manager) THEN "not BA" pros of BDD can be achieved much easier and faster
  • 64. Summary GIVEN no outside-in: no BA writing Gherkin AND no Devs writing tests before implementation AND automation engineers writing tests after WHEN Spock + dynamic Groovy AND Fluent PageObjects with Allure readable @Steps AND One Entry Point (aka Application Manager) THEN "not BA" pros of BDD can be achieved much easier and faster for some newcomers – too dynamic => prone to hardly debuggable errors but less "fluent" less parallel tests support test names as strings with spaces out of the box gherkin
  • 65. pseudo-BDD with xUnit/Spock, Fluent PageObjects, Allure @Steps, “Gherkined" One Entry Point • all-powerful programming language over textual-pseudo-language • full IDE support (autocompletion, auto-generate, etc.) • 1 abstraction layer less => simpler and faster in implementation • still fully readable and with pretty good reports • newcomers friendly • Just One Entry Point to all Application Model • structured with granular Fluent PageObjects => easier to learn&use via autocompletion
  • 66. Plan? Preface: BDD? BDD History Cucumber-like BDD tools “xUnit restyled to BDD” tools xUnit tools styled as BDD Summary Q&A now past Tools retrospective Future?
  • 67. Plan? Preface: BDD? BDD History Cucumber-like BDD tools “xUnit restyled to BDD” tools xUnit tools styled as BDD Summary Q&A now past Tools retrospective Future?
  • 68. Plan? Preface: BDD? BDD History Cucumber-like BDD tools “xUnit restyled to BDD” tools xUnit tools styled as BDD Summary Q&A now past Tools retrospective Future? with improved UX
  • 69. Plan? Preface: BDD? BDD History Cucumber-like BDD tools “xUnit restyled to BDD” tools xUnit tools styled as BDD Summary Q&A now past Tools retrospective Future? X tool
  • 70. Afterwords There are good practices in context, but there are no best practices. (c) Cem Kaner, James Bach
  • 71. Q&A
  • 73. You are welcome;) Selene in Python NSelene in C# Selenide snippets in Java Yashaka talks src code Selenide User Guide @yashaka
  • 74. We are looking for talents automician@gmail.com