SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
RÉALISER UNE BONNE RECETTE AU
CONCOMBRE
#bdd
shoun.ichida@viseo.com
Shoun ICHIDA
@ishoun
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
QU’APPORTE-T-ELLE ?
➡ Un complément au Test Driven Development (TDD)
5
TEST QUI RÉUSSIT
TEST

QUI ÉCHOUE
Refactoring
TDD Test
d’Acceptation
CAS PRATIQUE
En tant que cuisinier, je souhaite noter
une liste de recette
La liste des recettes disponibles est
représentée sur une page
Lorsque je sélectionne une recette, je
peux lui attribuer une note comprise entre
0 et 10
He should be able to select oneAnd
LE GHERKIN
7
Given
When
Then
Scenario:List all existing recipes
"shoun" is authenticated
He requests a list of all recipes
He should have a list of recipes
And There is an existing list of recipes
Feature: List recipes
public class RecipeStepdefs {



@Given("^"([^"]*)" is authenticated$")

public void userIsAuthenticated(String user) throws Throwable {

// Your test goes here

}

CUCUMBER-JVM
8
public class RecipeStepdefs {



@Given("^"([^"]*)" is authenticated$")

public void userIsAuthenticated(String user) throws Throwable {

// Your test goes here

}



@When("^He requests a list of all recipes$")

public void heRequestsAListOfAllRecipes() throws Throwable {

// Your test goes here
}



@Then("^He should have a list of recipes$")

public void heShouldHaveAListOfRecipes() throws Throwable {

// Your test goes here

}

}
public class RecipeStepdefs {



@Given("^"([^"]*)" is authenticated$")

public void userIsAuthenticated(String user) throws Throwable {

// Your test goes here

}

CUCUMBER-JVM
8
Expression
régulièrepublic class RecipeStepdefs {



@Given("^"([^"]*)" is authenticated$")

public void userIsAuthenticated(String user) throws Throwable {

// Your test goes here

}



@When("^He requests a list of all recipes$")

public void heRequestsAListOfAllRecipes() throws Throwable {

// Your test goes here
}



@Then("^He should have a list of recipes$")

public void heShouldHaveAListOfRecipes() throws Throwable {

// Your test goes here

}

}
public class RecipeStepdefs {



@Given("^"([^"]*)" is authenticated$")

public void userIsAuthenticated(String user) throws Throwable {

// Your test goes here

}

CUCUMBER-JVM
8
Expression
régulière
Given "shoun" is authenticated
public class RecipeStepdefs {



@Given("^"([^"]*)" is authenticated$")

public void userIsAuthenticated(String user) throws Throwable {

// Your test goes here

}



@When("^He requests a list of all recipes$")

public void heRequestsAListOfAllRecipes() throws Throwable {

// Your test goes here
}



@Then("^He should have a list of recipes$")

public void heShouldHaveAListOfRecipes() throws Throwable {

// Your test goes here

}

}
CUCUMBER-JVM - JAVA 8
9
public class RecipeJava8Stepdefs implements En {

public RecipeJava8Stepdefs() {

Given("^"([^"]*)" is authenticated$", () -> {

// Your test goes here

});

When("^He requests a list of all recipes$", () -> {

// Your test goes here

});

Then("^He should have of list of recipes$", () -> {

// Your test goes here

});

}

}
I18N ?
# language: fr
11
# language: fr

Fonctionnalité: noter une recette

En tant que cuisinier

Je souhaite noter mes recettes

Afin de les évaluer



Scénario: Je peux noter la recette "Salade de concombre"

Etant donné que "Shoun" est authentifié

Et que les recettes suivantes existent:

| Name | Description |

| Salade de concombre | Salade à base de concombre |

| Salade de crudité | Mélange de salade, tomate et crevettes |

Lorsqu' il attribue la note de 8 la recette "Salade de concombre"

Alors la recette "Salade de concombre" devrait avoir la note de 8

IMPLÉMENTATION
12
@Etantdonné("^que "([^"]*)" est authentifié$")

public void queEstAuthentifié() throws Throwable {

// TODO
}



@Et("^que les recettes suivantes existent:$")

public void queLesRecettesSuivantesExistent(List<Recipe> recipes) throws Throwable {

// TODO

}



@Lorsqu("^il attribue la note de (d+) la recette "([^"]*)"$")

public void ilAttribueLaNoteDeLaRecette(int mark, String recipe) throws Throwable {

// TODO

}



@Alors("^la recette "([^"]*)" devrait avoir la note de (d+)$")

public void laRecetteDevraitAvoirLaNote(String recipe, int mark) throws Throwable {

// TODO

}
SOLUTIONS
Retour d’expérience
Mais le BDD, ça fonctionne
vraiment ?
Projet existant
Java & AngularJS
4 Développeurs
1 Business Analyst
1 Scrum Master
24 Sprints
40% de couverture de tests
Client insatisfait
Produit jamais utilisé en
production
Contexte
16
Contexte
Équipe hétérogène
17
Je connais le
produit…
J’ai
lu des trucs
sur le BDD
C’est vrai?
Moi pas du tout..
J’ai un peu
d’expérience en
BDD
Mais qu’est-ce
que c’est que cette
@&%#$ ??!
… et je suis
un super Scrum
Master
Déroulement
Cérémonie BDD
18
Que
pensez-vous
de…Je
pense que cette
fonctionnalité…
Pourquoi
ne faisons-nous
pas…
Si on parlait
de…
Meilleure compréhension du besoin
Moins de retours client
Meilleure couverture des tests
Meilleure implication de l’équipe de développement
Moins de bugs
Meilleure productivité
Bénéfices attendus
19
Bénéfices attendus
19
Meilleure compréhension du besoin
Moins de retours client
Meilleure couverture des tests
Meilleure implication de l’équipe de développement
Moins de bugs
Meilleure productivité
Quelles en sont les causes ?
Écriture des Gherkin
Sous-évaluation des tâches
Refactoring coûteux sur les anciennes fonctionnalités
Coupler BDD et TDD
Réticence à l’écriture de scénarios
Pas d’amélioration de la productivité
20
Retour d’expérience
Tous les membres de l’équipe doivent
s’impliquer
Le Product Owner / Business Analyst doit
être rigoureux
Le temps passé sur les scénarios est utile
mais coûteux
Si les besoins évoluent le risque de
régression est maîtrisé
Une nette amélioration qualitative a été
remarquée
JGiven
ATDD
Alternatives à cucumber ?
22
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/
agile_france/cucumber-example
https://github.com/cucumber/cucumber/wiki/Spoken-
languages
Retrouvez-moi
à Agile France le 17 juin
à Agile Laval le 30 juin
sur le blog Viseo http://blog.viseo-bt.com/
author/s-ichida/
sur Twitter @ishoun
Avez-vous des questions ?
?

Contenu connexe

Dernier (6)

Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
Présentation_Soirée-Information_ Surverse_Thibert _30 avril 2024
 
JTC 2024 Bâtiment et Photovoltaïque.pdf
JTC 2024  Bâtiment et Photovoltaïque.pdfJTC 2024  Bâtiment et Photovoltaïque.pdf
JTC 2024 Bâtiment et Photovoltaïque.pdf
 
le probleme de la planification JSP exposee (2) (2).pptx
le probleme de la planification JSP exposee (2) (2).pptxle probleme de la planification JSP exposee (2) (2).pptx
le probleme de la planification JSP exposee (2) (2).pptx
 
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdfpdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
pdfcoffee.com_4-production-fond-des-puits-completion-pdf-free.pdf
 
Algo II: les files cours + exercices corrigés
Algo II: les files cours + exercices corrigésAlgo II: les files cours + exercices corrigés
Algo II: les files cours + exercices corrigés
 
mémoire genie civil presenté lors de la soutenance de mémoire
mémoire genie civil presenté lors de la soutenance de mémoiremémoire genie civil presenté lors de la soutenance de mémoire
mémoire genie civil presenté lors de la soutenance de mémoire
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Réaliser une bonne recette au concombre - Agile Testing Paris

  • 1. RÉALISER UNE BONNE RECETTE AU CONCOMBRE #bdd shoun.ichida@viseo.com Shoun ICHIDA @ishoun
  • 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. QU’APPORTE-T-ELLE ? ➡ Un complément au Test Driven Development (TDD) 5 TEST QUI RÉUSSIT TEST
 QUI ÉCHOUE Refactoring TDD Test d’Acceptation
  • 6. CAS PRATIQUE En tant que cuisinier, je souhaite noter une liste de recette La liste des recettes disponibles est représentée sur une page Lorsque je sélectionne une recette, je peux lui attribuer une note comprise entre 0 et 10
  • 7. He should be able to select oneAnd LE GHERKIN 7 Given When Then Scenario:List all existing recipes "shoun" is authenticated He requests a list of all recipes He should have a list of recipes And There is an existing list of recipes Feature: List recipes
  • 8. public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is authenticated$")
 public void userIsAuthenticated(String user) throws Throwable {
 // Your test goes here
 }
 CUCUMBER-JVM 8 public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is authenticated$")
 public void userIsAuthenticated(String user) throws Throwable {
 // Your test goes here
 }
 
 @When("^He requests a list of all recipes$")
 public void heRequestsAListOfAllRecipes() throws Throwable {
 // Your test goes here }
 
 @Then("^He should have a list of recipes$")
 public void heShouldHaveAListOfRecipes() throws Throwable {
 // Your test goes here
 }
 }
  • 9. public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is authenticated$")
 public void userIsAuthenticated(String user) throws Throwable {
 // Your test goes here
 }
 CUCUMBER-JVM 8 Expression régulièrepublic class RecipeStepdefs {
 
 @Given("^"([^"]*)" is authenticated$")
 public void userIsAuthenticated(String user) throws Throwable {
 // Your test goes here
 }
 
 @When("^He requests a list of all recipes$")
 public void heRequestsAListOfAllRecipes() throws Throwable {
 // Your test goes here }
 
 @Then("^He should have a list of recipes$")
 public void heShouldHaveAListOfRecipes() throws Throwable {
 // Your test goes here
 }
 }
  • 10. public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is authenticated$")
 public void userIsAuthenticated(String user) throws Throwable {
 // Your test goes here
 }
 CUCUMBER-JVM 8 Expression régulière Given "shoun" is authenticated public class RecipeStepdefs {
 
 @Given("^"([^"]*)" is authenticated$")
 public void userIsAuthenticated(String user) throws Throwable {
 // Your test goes here
 }
 
 @When("^He requests a list of all recipes$")
 public void heRequestsAListOfAllRecipes() throws Throwable {
 // Your test goes here }
 
 @Then("^He should have a list of recipes$")
 public void heShouldHaveAListOfRecipes() throws Throwable {
 // Your test goes here
 }
 }
  • 11. CUCUMBER-JVM - JAVA 8 9 public class RecipeJava8Stepdefs implements En {
 public RecipeJava8Stepdefs() {
 Given("^"([^"]*)" is authenticated$", () -> {
 // Your test goes here
 });
 When("^He requests a list of all recipes$", () -> {
 // Your test goes here
 });
 Then("^He should have of list of recipes$", () -> {
 // Your test goes here
 });
 }
 }
  • 13. # language: fr 11 # language: fr
 Fonctionnalité: noter une recette
 En tant que cuisinier
 Je souhaite noter mes recettes
 Afin de les évaluer
 
 Scénario: Je peux noter la recette "Salade de concombre"
 Etant donné que "Shoun" est authentifié
 Et que les recettes suivantes existent:
 | Name | Description |
 | Salade de concombre | Salade à base de concombre |
 | Salade de crudité | Mélange de salade, tomate et crevettes |
 Lorsqu' il attribue la note de 8 la recette "Salade de concombre"
 Alors la recette "Salade de concombre" devrait avoir la note de 8

  • 14. IMPLÉMENTATION 12 @Etantdonné("^que "([^"]*)" est authentifié$")
 public void queEstAuthentifié() throws Throwable {
 // TODO }
 
 @Et("^que les recettes suivantes existent:$")
 public void queLesRecettesSuivantesExistent(List<Recipe> recipes) throws Throwable {
 // TODO
 }
 
 @Lorsqu("^il attribue la note de (d+) la recette "([^"]*)"$")
 public void ilAttribueLaNoteDeLaRecette(int mark, String recipe) throws Throwable {
 // TODO
 }
 
 @Alors("^la recette "([^"]*)" devrait avoir la note de (d+)$")
 public void laRecetteDevraitAvoirLaNote(String recipe, int mark) throws Throwable {
 // TODO
 }
  • 17. Mais le BDD, ça fonctionne vraiment ?
  • 18. Projet existant Java & AngularJS 4 Développeurs 1 Business Analyst 1 Scrum Master 24 Sprints 40% de couverture de tests Client insatisfait Produit jamais utilisé en production Contexte 16
  • 19. Contexte Équipe hétérogène 17 Je connais le produit… J’ai lu des trucs sur le BDD C’est vrai? Moi pas du tout.. J’ai un peu d’expérience en BDD Mais qu’est-ce que c’est que cette @&%#$ ??! … et je suis un super Scrum Master
  • 20. Déroulement Cérémonie BDD 18 Que pensez-vous de…Je pense que cette fonctionnalité… Pourquoi ne faisons-nous pas… Si on parlait de…
  • 21. Meilleure compréhension du besoin Moins de retours client Meilleure couverture des tests Meilleure implication de l’équipe de développement Moins de bugs Meilleure productivité Bénéfices attendus 19
  • 22. Bénéfices attendus 19 Meilleure compréhension du besoin Moins de retours client Meilleure couverture des tests Meilleure implication de l’équipe de développement Moins de bugs Meilleure productivité
  • 23. Quelles en sont les causes ? Écriture des Gherkin Sous-évaluation des tâches Refactoring coûteux sur les anciennes fonctionnalités Coupler BDD et TDD Réticence à l’écriture de scénarios Pas d’amélioration de la productivité 20
  • 24. Retour d’expérience Tous les membres de l’équipe doivent s’impliquer Le Product Owner / Business Analyst doit être rigoureux Le temps passé sur les scénarios est utile mais coûteux Si les besoins évoluent le risque de régression est maîtrisé Une nette amélioration qualitative a été remarquée
  • 26. Pour aller plus loin…
  • 28. Retrouvez-moi à Agile France le 17 juin à Agile Laval le 30 juin sur le blog Viseo http://blog.viseo-bt.com/ author/s-ichida/ sur Twitter @ishoun