SlideShare a Scribd company logo
Solving communication problems
in distributed teams with BDD
Rodrigo Urubatan
Developer, Writer, Crossfitter, Archer
What is the biggest problem in software
projects?
What is the root cause for this
problem?
What do we need to solve this
problem?
How to solve this problem?
Ok, but how’s that going to help design
software?
• Business value is the key
• What is the next important thing the system does not do
yet?
• Use the business language to specify the software
• Use the business language to test the software
• Use the business language to write the software
• Use the business language to validate the software
User Stories!!
•As a …
•I want to ...
•So that ...
•AS A BANK CLIENT
•I WANT TO USE THE
CASH MACHINE
•SO THAT I CAN TAKE
MONEY FROM MY
ACCOUNT
Need to see it everywhere
But it is not enough!
Behaviour Specification
• Context
• Actions
• Verification
•GIVEN THERE IS MONEY IN MY ACCOUNT
•AND I HAVE A VALID CARD
•AND THE MONEY DISPENSER HAS MONEY
•WHEN I ASK THE MACHINE FOR MONEY
•THEN THE MONEY SHOULD BE SUBTRACTED FROM
MY ACCOUNT
•AND THE MONEY SHOULD BE DELIVERED TO ME
•AND MY CARD SHOULD BE RETURNED
But how much details can I get?
Have you seen that sintaxe anywhere before?
Did you remember where?
• In tester spreadsheets, sometimes with columns
instead of given/when/then
• It is almost the syntax for the gherkin language!!
What if I use the same business words to name things in
code?
Let’s try that!
• GIVEN THERE IS MONEY IN MY ACCOUNT
• AND I HAVE A VALID CARD
• AND THE MONEY DISPENSER HAS MONEY
• WHEN I ASK THE MACHINE FOR MONEY
• THEN THE MONEY SHOULD BE SUBTRACTED
FROM MY ACCOUNT
• AND THE MONEY SHOULD BE DELIVERED TO
ME
• AND MY CARD SHOULD BE RETURNED
•ACCOUNT.HAS_ENOUGH_MONEY?(VALUE)
•CARD.VALID?
•DISPENSER.HAS_MONEY?
•MACHINE.I_WANT(VALUE)
•ACCOUNT.SUBTRACT(VALUE)
•MACHINE.DELIVER_MONEY(VALUE)
•MACHINE.RETURN_CARD
Wow! Everyone talks the same
language!
BDD Development cycle
Talk to the client,
write a user story
or
Select a user
story
Detail the
story into
scenarions
Automate
scenarios with
selected tool
Run tests and
see them fail
Write ony
the code to
make tests
pass
Refactor
Almost the same as TDD?
OK, how is that different from TDD “Red,
green, refactor”?
• The main focus is not the test, in reality the automate step can be
skiped sometimes
• The main focus is on communication
• Test business behaviour not language dependent functions
• Behaviour is more important to the software than how it was
implemented
• The main focus in using a ubiquitous language like in DDD
• Using the ubiquitous language, the user story template and the
scenario template the communication with the entire team will
improve a lot
Haven’t we forgot about test automation?
That same context sintaxe can be
automated by:
• Cucumber using gherkin - https://cucumber.io/
• Thoughtworks gauge - http://getgauge.io/
• Rspec can use that syntax to name the test specs
• Jbehave was created thinking about that
• Specflow using gherkin - http://www.specflow.org/
Sample gherkin code
Feature: A sample code for my presentation
As a speaker
I want to have some code samples
So that everyone understand what I'm talking about
Scenario: doing a simple google search
Given I'm on the google home page
When I fill the search field with "Urubatan"
Then I want to see "my web page" in the results
And I want to see "my facebook profile" in the results
Sample cucumber RuBY code
Given(/^I'm on the google home page$/) do
pending # express the regexp above with the code you wish you had
end
When(/^I fill the search field with "(.*?)"$/) do |arg1|
pending # express the regexp above with the code you wish you had
end
Then(/^I want to see "(.*?)" in the results$/) do |arg1|
pending # express the regexp above with the code you wish you had
end
SAMPLE CUCUMBER JAVA CODE
public class MyStepdefs {
@cucumber.api.java.en.Then("^I want to see "([^"]*)" in the results$")
public void iWantToSeeInTheResults(String arg0) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
@cucumber.api.java.en.When("^I fill the search field with "([^"]*)"$")
public void iFillTheSearchFieldWith(String arg0) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
@cucumber.api.java.en.Given("^I'm on the google home page$")
public void iMOnTheGoogleHomePage() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
}
Sample gauge code
A sample code for my presentation
=============
As a speaker, I want to have some code samples, So that everyone understand
what I'm talking about
doing a simple google search
-----------
* I'm on the google home page
* I fill the search field with "Urubatan"
* I want to see "my web page" in the results
* I want to see "my facebook profile" in the results
SAMPLE GAUGE JAVA CODE
public class SampleGauge {
@Step("I'm on the google home page")
public void goToGoogle() {
// Step implementation
}
@Step("I fill the search field with <value>")
public void fillField(String value) {
// Step implementation
}
@Step("I want to see <addr> in the results")
public void checkValue(String value) {
// Step implementation
}
}
Sample gauge ruby code
step "I'm on the google home page" do
end
step "I fill the search field with <name>" do |name|
end
step "I want to see <address> in the results" |address|
end
Rodrigo Urubatan
• http://www.urubatan.com.br
• http://sobrecodigo.com
• Twitter @urubatan
• http://github.com/urubatan
• http://linkedin.com/in/urubatan
• http://fb.com/urubatan

More Related Content

Similar to Rubyconf2016 - Solving communication problems in distributed teams with BDD

resolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bddresolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bdd
Rodrigo Urubatan
 
Using BDD to Solve communication problems
Using BDD to Solve communication problemsUsing BDD to Solve communication problems
Using BDD to Solve communication problems
Rodrigo Urubatan
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Jean-Loup Yu
 
Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Brutal refactoring, lying code, the Churn, and other emotional stories from L...Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Matthias Noback
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
Luis Goldster
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
Fraboni Ec
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
James Wong
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
Harry Potter
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
Young Alista
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
Hoang Nguyen
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
Tony Nguyen
 
Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)
Scott Wlaschin
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job Easier
Tonya Mork
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
Doris Chen
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bdd
Prince Gupta
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User Stories
Sauce Labs
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
Sam Davarnia
 
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
ruthmcdavitt
 
Beyond MVC: from Model to Domain
Beyond MVC: from Model to DomainBeyond MVC: from Model to Domain
Beyond MVC: from Model to Domain
Jeremy Cook
 
Domain Specific Languages
Domain Specific LanguagesDomain Specific Languages
Domain Specific Languages
Wee Witthawaskul
 

Similar to Rubyconf2016 - Solving communication problems in distributed teams with BDD (20)

resolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bddresolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bdd
 
Using BDD to Solve communication problems
Using BDD to Solve communication problemsUsing BDD to Solve communication problems
Using BDD to Solve communication problems
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
 
Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Brutal refactoring, lying code, the Churn, and other emotional stories from L...Brutal refactoring, lying code, the Churn, and other emotional stories from L...
Brutal refactoring, lying code, the Churn, and other emotional stories from L...
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
 
Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)Reinventing the Transaction Script (NDC London 2020)
Reinventing the Transaction Script (NDC London 2020)
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job Easier
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bdd
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User Stories
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
SoTWLG Intro to Code Bootcamps 2016 (Roger Nesbitt)
 
Beyond MVC: from Model to Domain
Beyond MVC: from Model to DomainBeyond MVC: from Model to Domain
Beyond MVC: from Model to Domain
 
Domain Specific Languages
Domain Specific LanguagesDomain Specific Languages
Domain Specific Languages
 

More from Rodrigo Urubatan

Ruby code smells
Ruby code smellsRuby code smells
Ruby code smells
Rodrigo Urubatan
 
Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?
Rodrigo Urubatan
 
Data science in ruby, is it possible? is it fast? should we use it?
Data science in ruby, is it possible? is it fast? should we use it?Data science in ruby, is it possible? is it fast? should we use it?
Data science in ruby, is it possible? is it fast? should we use it?
Rodrigo Urubatan
 
2018 the conf put git to work - increase the quality of your rails project...
2018 the conf   put git to work -  increase the quality of your rails project...2018 the conf   put git to work -  increase the quality of your rails project...
2018 the conf put git to work - increase the quality of your rails project...
Rodrigo Urubatan
 
2018 RubyHACK: put git to work - increase the quality of your rails project...
2018 RubyHACK:  put git to work -  increase the quality of your rails project...2018 RubyHACK:  put git to work -  increase the quality of your rails project...
2018 RubyHACK: put git to work - increase the quality of your rails project...
Rodrigo Urubatan
 
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...
Rodrigo Urubatan
 
Your first game with unity3d framework
Your first game with unity3d frameworkYour first game with unity3d framework
Your first game with unity3d framework
Rodrigo Urubatan
 
Tdc Floripa 2017 - 8 falácias da programação distribuída
Tdc Floripa 2017 -  8 falácias da programação distribuídaTdc Floripa 2017 -  8 falácias da programação distribuída
Tdc Floripa 2017 - 8 falácias da programação distribuída
Rodrigo Urubatan
 
vantagens e desvantagens de trabalhar remoto
vantagens e desvantagens de trabalhar remotovantagens e desvantagens de trabalhar remoto
vantagens e desvantagens de trabalhar remoto
Rodrigo Urubatan
 
TDC2015 Porto Alegre - Interfaces ricas com Rails e React.JS
TDC2015  Porto Alegre - Interfaces ricas com Rails e React.JSTDC2015  Porto Alegre - Interfaces ricas com Rails e React.JS
TDC2015 Porto Alegre - Interfaces ricas com Rails e React.JS
Rodrigo Urubatan
 
Interfaces ricas com Rails e React.JS @ Rubyconf 2015
Interfaces ricas com Rails e React.JS @ Rubyconf 2015Interfaces ricas com Rails e React.JS @ Rubyconf 2015
Interfaces ricas com Rails e React.JS @ Rubyconf 2015
Rodrigo Urubatan
 
TDC São Paulo 2015 - Interfaces Ricas com Rails e React.JS
TDC São Paulo 2015  - Interfaces Ricas com Rails e React.JSTDC São Paulo 2015  - Interfaces Ricas com Rails e React.JS
TDC São Paulo 2015 - Interfaces Ricas com Rails e React.JS
Rodrigo Urubatan
 
Full Text Search com Solr, MySQL Full text e PostgreSQL Full Text
Full Text Search com Solr, MySQL Full text e PostgreSQL Full TextFull Text Search com Solr, MySQL Full text e PostgreSQL Full Text
Full Text Search com Solr, MySQL Full text e PostgreSQL Full Text
Rodrigo Urubatan
 
Ruby para programadores java
Ruby para programadores javaRuby para programadores java
Ruby para programadores java
Rodrigo Urubatan
 
Treinamento html5, css e java script apresentado na HP
Treinamento html5, css e java script apresentado na HPTreinamento html5, css e java script apresentado na HP
Treinamento html5, css e java script apresentado na HP
Rodrigo Urubatan
 
Ruby on rails impressione a você mesmo, seu chefe e seu cliente
Ruby on rails  impressione a você mesmo, seu chefe e seu clienteRuby on rails  impressione a você mesmo, seu chefe e seu cliente
Ruby on rails impressione a você mesmo, seu chefe e seu cliente
Rodrigo Urubatan
 
Mini curso rails 3
Mini curso rails 3Mini curso rails 3
Mini curso rails 3
Rodrigo Urubatan
 
Aplicações Hibridas com Phonegap e HTML5
Aplicações Hibridas com Phonegap e HTML5Aplicações Hibridas com Phonegap e HTML5
Aplicações Hibridas com Phonegap e HTML5
Rodrigo Urubatan
 
Git presentation to some coworkers some time ago
Git presentation to some coworkers some time agoGit presentation to some coworkers some time ago
Git presentation to some coworkers some time ago
Rodrigo Urubatan
 
Intrudução ao Behavior Driven Development (BDD) com Ruby on Rails
Intrudução ao Behavior Driven Development (BDD) com Ruby on RailsIntrudução ao Behavior Driven Development (BDD) com Ruby on Rails
Intrudução ao Behavior Driven Development (BDD) com Ruby on Rails
Rodrigo Urubatan
 

More from Rodrigo Urubatan (20)

Ruby code smells
Ruby code smellsRuby code smells
Ruby code smells
 
Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?
 
Data science in ruby, is it possible? is it fast? should we use it?
Data science in ruby, is it possible? is it fast? should we use it?Data science in ruby, is it possible? is it fast? should we use it?
Data science in ruby, is it possible? is it fast? should we use it?
 
2018 the conf put git to work - increase the quality of your rails project...
2018 the conf   put git to work -  increase the quality of your rails project...2018 the conf   put git to work -  increase the quality of your rails project...
2018 the conf put git to work - increase the quality of your rails project...
 
2018 RubyHACK: put git to work - increase the quality of your rails project...
2018 RubyHACK:  put git to work -  increase the quality of your rails project...2018 RubyHACK:  put git to work -  increase the quality of your rails project...
2018 RubyHACK: put git to work - increase the quality of your rails project...
 
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...
TDC2017 - POA - Aprendendo a usar Xamarin para desenvolver aplicações moveis ...
 
Your first game with unity3d framework
Your first game with unity3d frameworkYour first game with unity3d framework
Your first game with unity3d framework
 
Tdc Floripa 2017 - 8 falácias da programação distribuída
Tdc Floripa 2017 -  8 falácias da programação distribuídaTdc Floripa 2017 -  8 falácias da programação distribuída
Tdc Floripa 2017 - 8 falácias da programação distribuída
 
vantagens e desvantagens de trabalhar remoto
vantagens e desvantagens de trabalhar remotovantagens e desvantagens de trabalhar remoto
vantagens e desvantagens de trabalhar remoto
 
TDC2015 Porto Alegre - Interfaces ricas com Rails e React.JS
TDC2015  Porto Alegre - Interfaces ricas com Rails e React.JSTDC2015  Porto Alegre - Interfaces ricas com Rails e React.JS
TDC2015 Porto Alegre - Interfaces ricas com Rails e React.JS
 
Interfaces ricas com Rails e React.JS @ Rubyconf 2015
Interfaces ricas com Rails e React.JS @ Rubyconf 2015Interfaces ricas com Rails e React.JS @ Rubyconf 2015
Interfaces ricas com Rails e React.JS @ Rubyconf 2015
 
TDC São Paulo 2015 - Interfaces Ricas com Rails e React.JS
TDC São Paulo 2015  - Interfaces Ricas com Rails e React.JSTDC São Paulo 2015  - Interfaces Ricas com Rails e React.JS
TDC São Paulo 2015 - Interfaces Ricas com Rails e React.JS
 
Full Text Search com Solr, MySQL Full text e PostgreSQL Full Text
Full Text Search com Solr, MySQL Full text e PostgreSQL Full TextFull Text Search com Solr, MySQL Full text e PostgreSQL Full Text
Full Text Search com Solr, MySQL Full text e PostgreSQL Full Text
 
Ruby para programadores java
Ruby para programadores javaRuby para programadores java
Ruby para programadores java
 
Treinamento html5, css e java script apresentado na HP
Treinamento html5, css e java script apresentado na HPTreinamento html5, css e java script apresentado na HP
Treinamento html5, css e java script apresentado na HP
 
Ruby on rails impressione a você mesmo, seu chefe e seu cliente
Ruby on rails  impressione a você mesmo, seu chefe e seu clienteRuby on rails  impressione a você mesmo, seu chefe e seu cliente
Ruby on rails impressione a você mesmo, seu chefe e seu cliente
 
Mini curso rails 3
Mini curso rails 3Mini curso rails 3
Mini curso rails 3
 
Aplicações Hibridas com Phonegap e HTML5
Aplicações Hibridas com Phonegap e HTML5Aplicações Hibridas com Phonegap e HTML5
Aplicações Hibridas com Phonegap e HTML5
 
Git presentation to some coworkers some time ago
Git presentation to some coworkers some time agoGit presentation to some coworkers some time ago
Git presentation to some coworkers some time ago
 
Intrudução ao Behavior Driven Development (BDD) com Ruby on Rails
Intrudução ao Behavior Driven Development (BDD) com Ruby on RailsIntrudução ao Behavior Driven Development (BDD) com Ruby on Rails
Intrudução ao Behavior Driven Development (BDD) com Ruby on Rails
 

Recently uploaded

“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 

Recently uploaded (20)

“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 

Rubyconf2016 - Solving communication problems in distributed teams with BDD

  • 1. Solving communication problems in distributed teams with BDD Rodrigo Urubatan Developer, Writer, Crossfitter, Archer
  • 2. What is the biggest problem in software projects?
  • 3. What is the root cause for this problem?
  • 4. What do we need to solve this problem?
  • 5. How to solve this problem?
  • 6. Ok, but how’s that going to help design software? • Business value is the key • What is the next important thing the system does not do yet? • Use the business language to specify the software • Use the business language to test the software • Use the business language to write the software • Use the business language to validate the software
  • 7.
  • 8. User Stories!! •As a … •I want to ... •So that ... •AS A BANK CLIENT •I WANT TO USE THE CASH MACHINE •SO THAT I CAN TAKE MONEY FROM MY ACCOUNT
  • 9. Need to see it everywhere
  • 10. But it is not enough!
  • 11. Behaviour Specification • Context • Actions • Verification •GIVEN THERE IS MONEY IN MY ACCOUNT •AND I HAVE A VALID CARD •AND THE MONEY DISPENSER HAS MONEY •WHEN I ASK THE MACHINE FOR MONEY •THEN THE MONEY SHOULD BE SUBTRACTED FROM MY ACCOUNT •AND THE MONEY SHOULD BE DELIVERED TO ME •AND MY CARD SHOULD BE RETURNED
  • 12. But how much details can I get?
  • 13. Have you seen that sintaxe anywhere before?
  • 14. Did you remember where? • In tester spreadsheets, sometimes with columns instead of given/when/then • It is almost the syntax for the gherkin language!!
  • 15. What if I use the same business words to name things in code?
  • 16. Let’s try that! • GIVEN THERE IS MONEY IN MY ACCOUNT • AND I HAVE A VALID CARD • AND THE MONEY DISPENSER HAS MONEY • WHEN I ASK THE MACHINE FOR MONEY • THEN THE MONEY SHOULD BE SUBTRACTED FROM MY ACCOUNT • AND THE MONEY SHOULD BE DELIVERED TO ME • AND MY CARD SHOULD BE RETURNED •ACCOUNT.HAS_ENOUGH_MONEY?(VALUE) •CARD.VALID? •DISPENSER.HAS_MONEY? •MACHINE.I_WANT(VALUE) •ACCOUNT.SUBTRACT(VALUE) •MACHINE.DELIVER_MONEY(VALUE) •MACHINE.RETURN_CARD
  • 17. Wow! Everyone talks the same language!
  • 18.
  • 19. BDD Development cycle Talk to the client, write a user story or Select a user story Detail the story into scenarions Automate scenarios with selected tool Run tests and see them fail Write ony the code to make tests pass Refactor Almost the same as TDD?
  • 20. OK, how is that different from TDD “Red, green, refactor”? • The main focus is not the test, in reality the automate step can be skiped sometimes • The main focus is on communication • Test business behaviour not language dependent functions • Behaviour is more important to the software than how it was implemented • The main focus in using a ubiquitous language like in DDD • Using the ubiquitous language, the user story template and the scenario template the communication with the entire team will improve a lot
  • 21. Haven’t we forgot about test automation?
  • 22. That same context sintaxe can be automated by: • Cucumber using gherkin - https://cucumber.io/ • Thoughtworks gauge - http://getgauge.io/ • Rspec can use that syntax to name the test specs • Jbehave was created thinking about that • Specflow using gherkin - http://www.specflow.org/
  • 23. Sample gherkin code Feature: A sample code for my presentation As a speaker I want to have some code samples So that everyone understand what I'm talking about Scenario: doing a simple google search Given I'm on the google home page When I fill the search field with "Urubatan" Then I want to see "my web page" in the results And I want to see "my facebook profile" in the results
  • 24. Sample cucumber RuBY code Given(/^I'm on the google home page$/) do pending # express the regexp above with the code you wish you had end When(/^I fill the search field with "(.*?)"$/) do |arg1| pending # express the regexp above with the code you wish you had end Then(/^I want to see "(.*?)" in the results$/) do |arg1| pending # express the regexp above with the code you wish you had end
  • 25. SAMPLE CUCUMBER JAVA CODE public class MyStepdefs { @cucumber.api.java.en.Then("^I want to see "([^"]*)" in the results$") public void iWantToSeeInTheResults(String arg0) throws Throwable { // Write code here that turns the phrase above into concrete actions throw new cucumber.api.PendingException(); } @cucumber.api.java.en.When("^I fill the search field with "([^"]*)"$") public void iFillTheSearchFieldWith(String arg0) throws Throwable { // Write code here that turns the phrase above into concrete actions throw new cucumber.api.PendingException(); } @cucumber.api.java.en.Given("^I'm on the google home page$") public void iMOnTheGoogleHomePage() throws Throwable { // Write code here that turns the phrase above into concrete actions throw new cucumber.api.PendingException(); } }
  • 26. Sample gauge code A sample code for my presentation ============= As a speaker, I want to have some code samples, So that everyone understand what I'm talking about doing a simple google search ----------- * I'm on the google home page * I fill the search field with "Urubatan" * I want to see "my web page" in the results * I want to see "my facebook profile" in the results
  • 27. SAMPLE GAUGE JAVA CODE public class SampleGauge { @Step("I'm on the google home page") public void goToGoogle() { // Step implementation } @Step("I fill the search field with <value>") public void fillField(String value) { // Step implementation } @Step("I want to see <addr> in the results") public void checkValue(String value) { // Step implementation } }
  • 28. Sample gauge ruby code step "I'm on the google home page" do end step "I fill the search field with <name>" do |name| end step "I want to see <address> in the results" |address| end
  • 29. Rodrigo Urubatan • http://www.urubatan.com.br • http://sobrecodigo.com • Twitter @urubatan • http://github.com/urubatan • http://linkedin.com/in/urubatan • http://fb.com/urubatan

Editor's Notes

  1. Tell the HP project story here, where BDD helped solve the fights between testers and developers
  2. What if we try to work as a team, and everyone has access to everyone, and we talk with each other? The developer can talk to the tester and to the client The tester can talk to the client and the developer
  3. Ubiquitous language needs to be a team effort, the client needs to define a dictionary and stick to it, the testers and developers should talk about everything using that dictionary, the code must be written using that same dictionary