SlideShare a Scribd company logo
1 of 20
Download to read offline
May The Feature Be
With You
#bdd
shoun.ichida@viseo.com
Shoun ICHIDA
@ishoun
#JUGToulouse
Behavior Driven
Development? ?
?
?
?
?
qu’est-ce que c’est ?
➡ Une méthodologie de développement
3
qu’apporte-t-elle ?
➡ Une meilleure compréhension du besoin
4
Besoin
Critères
d’acceptation
Tests
d’acceptation
Développement
Equipe métier
Equipe projet
➡ Un complément au Test Driven Development (TDD)
5
TEST QUI RÉUSSIT
TEST

QUI ÉCHOUE
Refactoring
TDD Test
d’Acceptation
qu’apporte-t-elle ?
Solutions
Le Gherkin
7
Given
When
Then
Scenario:Luke succeed to destroy the death star
"Luke" is flying an X-wing
He drops his torpedoes
The death star should be destroyed
Feature: Destroy the death star
Rebels should be able to win the warAnd
Le Gherkin
7
Given
When
Then
Scenario:Luke succeed to destroy the death star
"Luke" is flying an X-wing
He drops his torpedoes
The death star should be destroyed
And His vessel has torpedoes
Feature: Destroy the death star
public class RecipeStepdefs {



@Given("^"([^"]*)" is flying an X-wing$")

public void userIsFlyingAnXwing(String user) throws Throwable {

// Your test goes here

}

public class RecipeStepdefs {



@Given("^"([^"]*)" is flying an X-wing$")

public void userIsFlyingAnXwing(String user) throws Throwable {

// Your test goes here

}



@When("^He drops his torpedoes$")

public void heDropsHisTorpedeos() throws Throwable {

// Your test goes here
}



@Then(« ^The death star should be destroyed$")

public void theDeathStarShouldBeDestroyed() throws Throwable {

// Your test goes here

}

}
Cucumber-jvm
8
public class RecipeStepdefs {



@Given("^"([^"]*)" is flying an X-wing$")

public void userIsFlyingAnXwing(String user) throws Throwable {

// Your test goes here

}

public class RecipeStepdefs {



@Given("^"([^"]*)" is flying an X-wing$")

public void userIsFlyingAnXwing(String user) throws Throwable {

// Your test goes here

}



@When("^He drops his torpedoes$")

public void heDropsHisTorpedeos() throws Throwable {

// Your test goes here
}



@Then(« ^The death star should be destroyed$")

public void theDeathStarShouldBeDestroyed() throws Throwable {

// Your test goes here

}

}
Cucumber-jvm
8
Expression
régulière
public class RecipeStepdefs {



@Given("^"([^"]*)" is flying an X-wing$")

public void userIsFlyingAnXwing(String user) throws Throwable {

// Your test goes here

}

public class RecipeStepdefs {



@Given("^"([^"]*)" is flying an X-wing$")

public void userIsFlyingAnXwing(String user) throws Throwable {

// Your test goes here

}



@When("^He drops his torpedoes$")

public void heDropsHisTorpedeos() throws Throwable {

// Your test goes here
}



@Then(« ^The death star should be destroyed$")

public void theDeathStarShouldBeDestroyed() throws Throwable {

// Your test goes here

}

}
Cucumber-jvm
8
Expression
régulière
Given "Luke" is flying an X-wing
Cucumber-jvm - Java 8
9
public class RecipeJava8Stepdefs implements En {

public RecipeJava8Stepdefs() {

Given("^"([^"]*)" is flying an X-wing$", () -> {

// Your test goes here

});

When("^He drops his torpedoes$", () -> {

// Your test goes here

});

Then(« ^The death star should be destroyed$", () -> {

// Your test goes here

});

}

}
i18n ?
raaaaaahhgh
uughghhhgh aaaaahnr
uughghhhgh awwgggghhh
wuuh*
*Je ne comprends pas ce que tu dis
# language: fr
11
# language: fr

Fonctionnalité: Faire une course de racer

En tant que pilote

Je souhaite participer à une course

Afin de gagner



Scénario: Je participer à une course

Etant donné que "Luke" a un module de course

Lorsqu’il participe à la course

Alors il gagne
implémentation
12
@Etantdonné("^que "([^"]*)" a un module de course$")

public void queAUnModuleDeCourse(String personnage) throws Throwable {

// TODO
}



@Lorsqu("^il participe à la course$")

public void ilParticipeALaCourse() throws Throwable {

// TODO

}



@Alors("^il gagne$")

public void ilGagne() throws Throwable {

// TODO

}
Teach me the force
Mais le BDD,
ça fonctionne vraiment ?
Pour aller plus loin…
Références
http://dannorth.net/introducing-bdd/
http://blog.viseo-bt.com/as-viseo-we-went-to-cukeup-
so-we-can-improve-our-bdd/
https://cucumber.io
https://github.com/sichida/BDD-examples/tree/
jug_toulouse
https://github.com/cucumber/cucumber/wiki/Spoken-
languages
http://fr.slideshare.net/ichidashoun/
Avez-vous des
questions
?

More Related Content

Viewers also liked (9)

Danışmanlığa ilk adım
Danışmanlığa ilk adımDanışmanlığa ilk adım
Danışmanlığa ilk adım
 
Alko Saresehan
Alko  SaresehanAlko  Saresehan
Alko Saresehan
 
Steal this presentation
Steal this presentationSteal this presentation
Steal this presentation
 
Linda
LindaLinda
Linda
 
About my blog!
About my blog!About my blog!
About my blog!
 
Swap carrier eboard - BSP indonesia policy
Swap carrier eboard - BSP indonesia policySwap carrier eboard - BSP indonesia policy
Swap carrier eboard - BSP indonesia policy
 
Nachcpi2011
Nachcpi2011Nachcpi2011
Nachcpi2011
 
Englishtheplanets 090324130431-phpapp02
Englishtheplanets 090324130431-phpapp02Englishtheplanets 090324130431-phpapp02
Englishtheplanets 090324130431-phpapp02
 
British English versus American English
British English versus American EnglishBritish English versus American English
British English versus American English
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

May the feature be with you

  • 1. May The Feature Be With You #bdd shoun.ichida@viseo.com Shoun ICHIDA @ishoun #JUGToulouse
  • 3. qu’est-ce que c’est ? ➡ Une méthodologie de développement 3
  • 4. qu’apporte-t-elle ? ➡ Une meilleure compréhension du besoin 4 Besoin Critères d’acceptation Tests d’acceptation Développement Equipe métier Equipe projet
  • 5. ➡ Un complément au Test Driven Development (TDD) 5 TEST QUI RÉUSSIT TEST
 QUI ÉCHOUE Refactoring TDD Test d’Acceptation qu’apporte-t-elle ?
  • 7. Le Gherkin 7 Given When Then Scenario:Luke succeed to destroy the death star "Luke" is flying an X-wing He drops his torpedoes The death star should be destroyed Feature: Destroy the death star
  • 8. Rebels should be able to win the warAnd Le Gherkin 7 Given When Then Scenario:Luke succeed to destroy the death star "Luke" is flying an X-wing He drops his torpedoes The death star should be destroyed And His vessel has torpedoes Feature: Destroy the death star
  • 9. public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is flying an X-wing$")
 public void userIsFlyingAnXwing(String user) throws Throwable {
 // Your test goes here
 }
 public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is flying an X-wing$")
 public void userIsFlyingAnXwing(String user) throws Throwable {
 // Your test goes here
 }
 
 @When("^He drops his torpedoes$")
 public void heDropsHisTorpedeos() throws Throwable {
 // Your test goes here }
 
 @Then(« ^The death star should be destroyed$")
 public void theDeathStarShouldBeDestroyed() throws Throwable {
 // Your test goes here
 }
 } Cucumber-jvm 8
  • 10. public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is flying an X-wing$")
 public void userIsFlyingAnXwing(String user) throws Throwable {
 // Your test goes here
 }
 public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is flying an X-wing$")
 public void userIsFlyingAnXwing(String user) throws Throwable {
 // Your test goes here
 }
 
 @When("^He drops his torpedoes$")
 public void heDropsHisTorpedeos() throws Throwable {
 // Your test goes here }
 
 @Then(« ^The death star should be destroyed$")
 public void theDeathStarShouldBeDestroyed() throws Throwable {
 // Your test goes here
 }
 } Cucumber-jvm 8 Expression régulière
  • 11. public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is flying an X-wing$")
 public void userIsFlyingAnXwing(String user) throws Throwable {
 // Your test goes here
 }
 public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is flying an X-wing$")
 public void userIsFlyingAnXwing(String user) throws Throwable {
 // Your test goes here
 }
 
 @When("^He drops his torpedoes$")
 public void heDropsHisTorpedeos() throws Throwable {
 // Your test goes here }
 
 @Then(« ^The death star should be destroyed$")
 public void theDeathStarShouldBeDestroyed() throws Throwable {
 // Your test goes here
 }
 } Cucumber-jvm 8 Expression régulière Given "Luke" is flying an X-wing
  • 12. Cucumber-jvm - Java 8 9 public class RecipeJava8Stepdefs implements En {
 public RecipeJava8Stepdefs() {
 Given("^"([^"]*)" is flying an X-wing$", () -> {
 // Your test goes here
 });
 When("^He drops his torpedoes$", () -> {
 // Your test goes here
 });
 Then(« ^The death star should be destroyed$", () -> {
 // Your test goes here
 });
 }
 }
  • 13. i18n ? raaaaaahhgh uughghhhgh aaaaahnr uughghhhgh awwgggghhh wuuh* *Je ne comprends pas ce que tu dis
  • 14. # language: fr 11 # language: fr
 Fonctionnalité: Faire une course de racer
 En tant que pilote
 Je souhaite participer à une course
 Afin de gagner
 
 Scénario: Je participer à une course
 Etant donné que "Luke" a un module de course
 Lorsqu’il participe à la course
 Alors il gagne
  • 15. implémentation 12 @Etantdonné("^que "([^"]*)" a un module de course$")
 public void queAUnModuleDeCourse(String personnage) throws Throwable {
 // TODO }
 
 @Lorsqu("^il participe à la course$")
 public void ilParticipeALaCourse() throws Throwable {
 // TODO
 }
 
 @Alors("^il gagne$")
 public void ilGagne() throws Throwable {
 // TODO
 }
  • 16. Teach me the force
  • 17. Mais le BDD, ça fonctionne vraiment ?
  • 18. Pour aller plus loin…