iut agile lyon 20 nov. 2013 - bdd
TRANSCRIPT
![Page 1: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/1.jpg)
Behaviour-Driven Development
IUT Agile Lyon - 20 nov. 2013
@agnes_crepet
@AlfredAlmendra
![Page 2: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/2.jpg)
Java/JEE Architecte & Java Champion Laboratoires Boiron Ninja Squad Java User Groups Leader:
Duchess FranceLyonJUG
Co-fondatrice de la conférence
Agnès CREPET
![Page 4: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/4.jpg)
Acronymes
![Page 5: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/5.jpg)
Spécification par l’exemple
Spécification exécutable
![Page 6: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/6.jpg)
BDD : origine(s)
TDDTest Driven Development
![Page 7: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/7.jpg)
![Page 8: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/8.jpg)
BDD : origine(s)
USDDUser Story Driven Development
![Page 9: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/9.jpg)
BDD vs TDD
BDD parle un langage du métier, écrit en texte
TDD parle un langage technique, écrit en code
Complémentaires et non en conflit !
![Page 10: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/10.jpg)
BDD vs ATDD
ATDD est un paradigme générique d’automatisation des tests d’acceptation
BDD permet d’automatiser les tests, en mettant l’accent sur la communication
![Page 11: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/11.jpg)
BDD : origine(s)
DDDDomain Driven Design
![Page 12: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/12.jpg)
BDD : origine(s)
Dan North
Tester c’est décrire le
comportement
Un langageuniversel c’est la
clef
Automatiser les testsd’acceptation
Toute exigencedeviendra un
comportement
![Page 13: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/13.jpg)
BDD : pourquoi ? quels bénéfices ?
Visibilité sur l’avancement
Critère DONE
Démo réussie
Validation du but de l’itération
Acceptation du produit
Couverture des tests fonctionnels
Non régression
Etude d’impact
![Page 14: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/14.jpg)
BDD : quoi ?
Point de vue des utilisateurs finaux
DEMO :
CRAFTSMAN
PLAN
![Page 15: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/15.jpg)
BDD : quoi ?
Boîte noire
Aux frontières du système
On ne décrit pas le comment
![Page 16: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/16.jpg)
BDD : quoi ?
Décrire le comportementet non pas le fonctionnement
![Page 17: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/17.jpg)
BDD : quoi ?
Langage commun
Ubiquitous languagede DDD
![Page 18: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/18.jpg)
BDD : clés de la réussite
Découpagepriorisationcycle itératif et incrémental
Point de vuede l’utilisateurCollaboration
Intégration continue
Test First !
![Page 19: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/19.jpg)
Exemple avec should
→
![Page 20: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/20.jpg)
Exemple avec GherkinGiven the distance max is 50 km per day And I meet M John on “20/11/13” 10 km away And I meet Ms Shelp on “20/11/13” 12 km awayWhen I try to meet M Bob on “20/11/13” 8 km away Then I still have only 2 appointements on “20/11/13”
Structure de test → 1 méthode par step
![Page 21: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/21.jpg)
BDD : quand ?Découper
Estimer
S’engager
Coder Démontrer
UtiliserPréciser
![Page 22: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/22.jpg)
BDD From Scratch
Code
Spec
Test
Comment démarrer de zéro ?
![Page 23: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/23.jpg)
![Page 24: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/24.jpg)
RAD : Rapid Application Development
Exploration & émergence ⇒ refactoring
Make
Fake
Fake Make
Make
1 2Make
IHM
BdD
Métier
![Page 25: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/25.jpg)
Double loop TDD
Acceptance Test loop Unit Test loops
Refactor
Fail
Pass
![Page 26: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/26.jpg)
Maintenance BDD
Versionning des spécifications
?Refactoring des spécifications
Poser les bonnes questions
Etude d’impact
Expérimentation d’alternatives
![Page 27: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/27.jpg)
BDD sur du legacy
Legacy = non testé (automatiquement !)
On ajoute du BDD sur une application existante→ Non intrusif
Une nouvelle partie fonctionnelle : ok (serein)Une adaptation : impact ? effets de bords ?Une refonte : couverture en tests fonctionnels ?
![Page 28: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/28.jpg)
Retours terrain
Pas à pas : User Story, scénario d’acceptationTest First : discipline, paradigme
Test ? scénario, méthode, exécution, step
Gherkin : pas pour le métier, dur pour l’analysteStructuration d’un scénario en français : ok
Ne remplace pas : tests “après”, recette intégrée
![Page 29: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/29.jpg)
As a conclusion...
![Page 30: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/30.jpg)
Ressources
Un exemple BDD avec cucumber-JVM:https://github.com/acrepet/craftsmanplan
Le blog de Dan North:http://dannorth.net
![Page 31: Iut agile lyon 20 nov. 2013 - bdd](https://reader030.vdocuments.net/reader030/viewer/2022033100/55d566e5bb61eb413a8b46ff/html5/thumbnails/31.jpg)