SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
RODRIGO URUBATAN
• SOFTWARE DEVELOPER SINCE 1997
• WRITER, RUNNER,CROSSFITTER, SPEAKER, A
LITTLELAZY, ANDIN LOVE WITH REMOTE WORK
• HTTP://URUBATAN.COM.BR
• HTTP://SOBRECODIGO.COM
• HTTP://TWITTER.COM/URUBATAN
• HTTP://GITHUB.COM/URUBATAN
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 THATGOING TO HELP DESIGN SOFTWARE?
• BUSINESS VALUEIS THE KEY
• WHAT IS THE NEXTIMPORTANT THING THE SYSTEM DOES NOTDO 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
BUT IT IS NOT ENOUGH!
BEHAVIOUR SPECIFICATION
• CONTEXT
• ACTIONS
• VERIFICATION
• GIVEN THERE ISMONEY IN MY ACCOUNT
• AND I HAVE A VALID CARD
• AND THE MONEY DISPENSER HASMONEY
• WHEN I ASK THE MACHINE FOR MONEY
• THEN THE MONEYSHOULD BE SUBTRACTED FROM MY
ACCOUNT
• AND THE MONEY SHOULD BEDELIVERED TO ME
• AND MY CARD SHOULD BERETURNED
BUT HOW MUCHDETAILS CAN I GET?
HAVE YOU SEEN THAT SINTAXE ANYWHERE BEFORE?
DID YOU REMEMBER WHERE?
• IN TESTER SPREADSHEETS, SOMETIMES WITHCOLUMNS INSTEAD OF OF GIVEN/WHEN/THEN
• IT ISALMOST 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 ISMONEY IN MY ACCOUNT
• AND I HAVE A VALID CARD
• AND THE MONEY DISPENSER HASMONEY
• WHEN I ASK THE MACHINE FOR MONEY
• THEN THE MONEYSHOULD BE SUBTRACTED FROM MY
ACCOUNT
• AND THE MONEY SHOULD BEDELIVERED TO ME
• AND MY CARD SHOULD BERETURNED
• 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 ISNOT THE TEST, IN REALITY THE AUTOMATE STEP CAN BE SKIPED SOMETIMES
• THE MAIN FOCUS ISON COMMUNICATION
• TEST BUSINESS BEHAVIOUR NOTLANGUAGE DEPENDENT FUNCTIONS
• BEHAVIOUR IS MORE IMPORTANT TO THE SOFTWARE THAN HOW ITWAS IMPLEMENTED
• THE MAIN FOCUS IN USINGA UBIQUITOUSLANGUAGE LIKEIN DDD
• USING THE UBIQUITOUSLANGUAGE, THE USER STORY TEMPLATE ANDTHE SCENARIO TEMPLATE THE
COMMUNICATION WITH THE ENTIRETEAM WILL IMPROVE ALOT
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 THINKINGABOUT THAT
• SPECFLOW USINGGHERKIN - HTTP://WWW.SPECFLOW.ORG/
SAMPLE GHERKIN CODE
FEATURE:A SAMPLE CODE FORMY 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
GIVENI'M ONTHE GOOGLE HOME PAGE
WHENIFILL THE SEARCH FIELD WITH "URUBATAN"
THENIWANT TO SEE "MY WEB PAGE"INTHE RESULTS
AND I WANT TO SEE "MY FACEBOOKPROFILE"INTHE RESULTS
SAMPLE CUCUMBERRUBY CODE
GIVEN(/^I'M ONTHE GOOGLE HOME PAGE$/) DO
PENDING # EXPRESSTHE REGEXP ABOVE WITHTHE CODE YOUWISH YOU HAD
END
WHEN(/^IFILL THE SEARCH FIELD WITH "(.*?)"$/) DO |ARG1|
PENDING # EXPRESSTHE REGEXP ABOVE WITHTHE CODE YOUWISH YOU HAD
END
THEN(/^IWANT TO SEE "(.*?)"INTHE RESULTS$/) DO |ARG1|
PENDING # EXPRESSTHE REGEXP ABOVE WITHTHE CODE YOUWISH YOU HAD
END
SAMPLE CUCUMBERJAVA 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 FORMY PRESENTATION
=============
AS A SPEAKER, I WANT TO HAVE SOME CODE SAMPLES, SO THATEVERYONE UNDERSTAND WHATI'M TALKING ABOUT
DOING A SIMPLE GOOGLE SEARCH
-----------
*I'M ONTHE GOOGLE HOME PAGE
*I FILL THE SEARCH FIELD WITH "URUBATAN"
*I WANT TO SEE "MY WEB PAGE"INTHE RESULTS
*I WANT TO SEE "MY FACEBOOKPROFILE"INTHE 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 ONTHE GOOGLE HOME PAGE" DO
END
STEP "I FILL THE SEARCH FIELD WITH<NAME>" DO |NAME|
END
STEP "I WANT TOSEE <ADDRESS> INTHE RESULTS" |ADDRESS|
END

Contenu connexe

En vedette

Tema 2. La célula
Tema 2. La célulaTema 2. La célula
Tema 2. La célula
merchealari
 
Soft skills for effective interpersonal communication
Soft skills for effective interpersonal communicationSoft skills for effective interpersonal communication
Soft skills for effective interpersonal communication
Deepali Shirgaonkar
 
Introduction To Communication Theory
Introduction To Communication TheoryIntroduction To Communication Theory
Introduction To Communication Theory
Arun Jacob
 
Communication Theories
Communication TheoriesCommunication Theories
Communication Theories
Somaiya
 
Communication Concepts, Theories And Models1
Communication Concepts, Theories And Models1Communication Concepts, Theories And Models1
Communication Concepts, Theories And Models1
Suchitra Patnaik
 

En vedette (17)

CARA SAGITAL DEL CEREBRO
 CARA SAGITAL DEL CEREBRO CARA SAGITAL DEL CEREBRO
CARA SAGITAL DEL CEREBRO
 
Cell theories
Cell theoriesCell theories
Cell theories
 
Psychology Seminar Series 2013 - Ruth Laidler
Psychology Seminar Series 2013 - Ruth LaidlerPsychology Seminar Series 2013 - Ruth Laidler
Psychology Seminar Series 2013 - Ruth Laidler
 
A constructive naive set theory and infinity
A constructive naive set theory and infinityA constructive naive set theory and infinity
A constructive naive set theory and infinity
 
Tema 2. La célula
Tema 2. La célulaTema 2. La célula
Tema 2. La célula
 
Templates exception handling
Templates exception handlingTemplates exception handling
Templates exception handling
 
Unit 5 scientific theory - P1, M1 and D1
Unit 5   scientific theory - P1, M1 and D1Unit 5   scientific theory - P1, M1 and D1
Unit 5 scientific theory - P1, M1 and D1
 
Soft skills for effective interpersonal communication
Soft skills for effective interpersonal communicationSoft skills for effective interpersonal communication
Soft skills for effective interpersonal communication
 
Social Thinking
Social ThinkingSocial Thinking
Social Thinking
 
Theories of Communication
Theories of CommunicationTheories of Communication
Theories of Communication
 
Basic Theories Of Communication By Manish Sharma
Basic Theories Of Communication By Manish SharmaBasic Theories Of Communication By Manish Sharma
Basic Theories Of Communication By Manish Sharma
 
Introduction To Communication Theory
Introduction To Communication TheoryIntroduction To Communication Theory
Introduction To Communication Theory
 
Formal communication in an organization
Formal communication in an organizationFormal communication in an organization
Formal communication in an organization
 
Communication Theories
Communication TheoriesCommunication Theories
Communication Theories
 
communication errors
communication errorscommunication errors
communication errors
 
Communication Concepts, Theories And Models1
Communication Concepts, Theories And Models1Communication Concepts, Theories And Models1
Communication Concepts, Theories And Models1
 
Conflict Management
Conflict ManagementConflict Management
Conflict Management
 

Similaire à Using BDD to Solve communication problems

How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
Mike Harris
 
Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
CODEiD PHP Community
 
Behaviour drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
Young Alista
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
Tony Nguyen
 
Behaviour driven development
Behaviour driven developmentBehaviour driven development
Behaviour driven development
James Wong
 

Similaire à Using BDD to Solve communication problems (20)

Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
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
 
Choosing Javascript Libraries to Adopt for Development
Choosing Javascript Libraries to Adopt for DevelopmentChoosing Javascript Libraries to Adopt for Development
Choosing Javascript Libraries to Adopt for Development
 
Surviving your frontend (WIP - Sneak Peak)
Surviving your frontend (WIP - Sneak Peak)Surviving your frontend (WIP - Sneak Peak)
Surviving your frontend (WIP - Sneak Peak)
 
User Interface Testing | Best Practices
User Interface Testing | Best Practices User Interface Testing | Best Practices
User Interface Testing | Best Practices
 
What's the TCO for an OpenStack Cloud?
What's the TCO for an OpenStack Cloud? What's the TCO for an OpenStack Cloud?
What's the TCO for an OpenStack Cloud?
 
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
 
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
 
Lazy, Lazy, Lazy all the things !
Lazy, Lazy, Lazy all the things !Lazy, Lazy, Lazy all the things !
Lazy, Lazy, Lazy all the things !
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
 
Refactoring
RefactoringRefactoring
Refactoring
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
 
A Presentation on Presenting
A Presentation on PresentingA Presentation on Presenting
A Presentation on Presenting
 
Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Cucumber & BDD
Cucumber & BDDCucumber & BDD
Cucumber & BDD
 
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
 

Plus de 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
 

Plus de 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
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Using BDD to Solve communication problems

  • 1.
  • 2. RODRIGO URUBATAN • SOFTWARE DEVELOPER SINCE 1997 • WRITER, RUNNER,CROSSFITTER, SPEAKER, A LITTLELAZY, ANDIN LOVE WITH REMOTE WORK • HTTP://URUBATAN.COM.BR • HTTP://SOBRECODIGO.COM • HTTP://TWITTER.COM/URUBATAN • HTTP://GITHUB.COM/URUBATAN
  • 3. WHAT IS THE BIGGEST PROBLEM IN SOFTWARE PROJECTS?
  • 4. WHAT IS THE ROOT CAUSE FOR THIS PROBLEM?
  • 5. WHAT DO WE NEED TO SOLVE THIS PROBLEM?
  • 6. HOW TO SOLVE THIS PROBLEM?
  • 7. OK, BUT HOW’S THATGOING TO HELP DESIGN SOFTWARE? • BUSINESS VALUEIS THE KEY • WHAT IS THE NEXTIMPORTANT THING THE SYSTEM DOES NOTDO 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
  • 8.
  • 9. 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
  • 10. BUT IT IS NOT ENOUGH!
  • 11. BEHAVIOUR SPECIFICATION • CONTEXT • ACTIONS • VERIFICATION • GIVEN THERE ISMONEY IN MY ACCOUNT • AND I HAVE A VALID CARD • AND THE MONEY DISPENSER HASMONEY • WHEN I ASK THE MACHINE FOR MONEY • THEN THE MONEYSHOULD BE SUBTRACTED FROM MY ACCOUNT • AND THE MONEY SHOULD BEDELIVERED TO ME • AND MY CARD SHOULD BERETURNED
  • 12. BUT HOW MUCHDETAILS CAN I GET?
  • 13. HAVE YOU SEEN THAT SINTAXE ANYWHERE BEFORE?
  • 14. DID YOU REMEMBER WHERE? • IN TESTER SPREADSHEETS, SOMETIMES WITHCOLUMNS INSTEAD OF OF GIVEN/WHEN/THEN • IT ISALMOST 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 ISMONEY IN MY ACCOUNT • AND I HAVE A VALID CARD • AND THE MONEY DISPENSER HASMONEY • WHEN I ASK THE MACHINE FOR MONEY • THEN THE MONEYSHOULD BE SUBTRACTED FROM MY ACCOUNT • AND THE MONEY SHOULD BEDELIVERED TO ME • AND MY CARD SHOULD BERETURNED • 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 ISNOT THE TEST, IN REALITY THE AUTOMATE STEP CAN BE SKIPED SOMETIMES • THE MAIN FOCUS ISON COMMUNICATION • TEST BUSINESS BEHAVIOUR NOTLANGUAGE DEPENDENT FUNCTIONS • BEHAVIOUR IS MORE IMPORTANT TO THE SOFTWARE THAN HOW ITWAS IMPLEMENTED • THE MAIN FOCUS IN USINGA UBIQUITOUSLANGUAGE LIKEIN DDD • USING THE UBIQUITOUSLANGUAGE, THE USER STORY TEMPLATE ANDTHE SCENARIO TEMPLATE THE COMMUNICATION WITH THE ENTIRETEAM WILL IMPROVE ALOT
  • 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 THINKINGABOUT THAT • SPECFLOW USINGGHERKIN - HTTP://WWW.SPECFLOW.ORG/
  • 23. SAMPLE GHERKIN CODE FEATURE:A SAMPLE CODE FORMY 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 GIVENI'M ONTHE GOOGLE HOME PAGE WHENIFILL THE SEARCH FIELD WITH "URUBATAN" THENIWANT TO SEE "MY WEB PAGE"INTHE RESULTS AND I WANT TO SEE "MY FACEBOOKPROFILE"INTHE RESULTS
  • 24. SAMPLE CUCUMBERRUBY CODE GIVEN(/^I'M ONTHE GOOGLE HOME PAGE$/) DO PENDING # EXPRESSTHE REGEXP ABOVE WITHTHE CODE YOUWISH YOU HAD END WHEN(/^IFILL THE SEARCH FIELD WITH "(.*?)"$/) DO |ARG1| PENDING # EXPRESSTHE REGEXP ABOVE WITHTHE CODE YOUWISH YOU HAD END THEN(/^IWANT TO SEE "(.*?)"INTHE RESULTS$/) DO |ARG1| PENDING # EXPRESSTHE REGEXP ABOVE WITHTHE CODE YOUWISH YOU HAD END
  • 25. SAMPLE CUCUMBERJAVA 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 FORMY PRESENTATION ============= AS A SPEAKER, I WANT TO HAVE SOME CODE SAMPLES, SO THATEVERYONE UNDERSTAND WHATI'M TALKING ABOUT DOING A SIMPLE GOOGLE SEARCH ----------- *I'M ONTHE GOOGLE HOME PAGE *I FILL THE SEARCH FIELD WITH "URUBATAN" *I WANT TO SEE "MY WEB PAGE"INTHE RESULTS *I WANT TO SEE "MY FACEBOOKPROFILE"INTHE 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 ONTHE GOOGLE HOME PAGE" DO END STEP "I FILL THE SEARCH FIELD WITH<NAME>" DO |NAME| END STEP "I WANT TOSEE <ADDRESS> INTHE RESULTS" |ADDRESS| END