SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
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
?

Contenu connexe

En vedette

Danışmanlığa ilk adım
Danışmanlığa ilk adımDanışmanlığa ilk adım
Danışmanlığa ilk adımYUSUF KARABULUT
 
Steal this presentation
Steal this presentationSteal this presentation
Steal this presentationScott Hoag
 
Swap carrier eboard - BSP indonesia policy
Swap carrier eboard - BSP indonesia policySwap carrier eboard - BSP indonesia policy
Swap carrier eboard - BSP indonesia policydimasukma01
 
British English versus American English
British English versus American EnglishBritish English versus American English
British English versus American EnglishHai Long Huynh
 

En vedette (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
 

Dernier

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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 organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Dernier (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

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…