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

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Dernier (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

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…