SlideShare uma empresa Scribd logo
1 de 29
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

Mais conteúdo relacionado

Semelhante a Rubyconf2016 - Solving communication problems in distributed teams with BDD

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
 
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
Harry Potter
 

Semelhante a 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 drivendevelopment
Behaviour drivendevelopmentBehaviour drivendevelopment
Behaviour drivendevelopment
 
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
 
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
 

Mais 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
 

Mais 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
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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

Notas do Editor

  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