bdd avec behat, phpspec et symfony2

Post on 16-Jul-2015

83 Views

Category:

Technology

11 Downloads

Preview:

Click to see full reader

TRANSCRIPT

BDD SYMFONY TNrmed19

SLIDE 1

1

BDD &      SYMFONY

BDD SYMFONY TNrmed19

SLIDE 2

2

MohammedRhamnia

Symfonien depuis 7 ansConsultant Symfony@rmed19http://medrhamnia.workpress.com

BDD SYMFONY TNrmed19

SLIDE 3

3

DEFINEBDDIntroduction au Behaviour DrivenDevelopment

BDD SYMFONY TNrmed19

SLIDE 4

4

ÉCHEC D'UNPROJET

Retard de livraison

Coûts de finalisation élevés

Application ne répond pas au besoin

Instabilité après déploiement

Non respect des règles

Code non réutilisable

BDD SYMFONY TNrmed19

SLIDE 5

5

Répondre au besoin

S'adapter au changement de priorité

Diminuer le coût de changement

Se focaliser sur les fonctionnalités à fortevaleur ajoutée

S'adapter au feedback

RÉUSSITED'UNPROJET

BDD SYMFONY TNrmed19

SLIDE 6

6

AU COMMENCEMENTÉTAIT LE TDD, ET LE TDDÉTAIT AVEC EXP

BDD SYMFONY TNrmed19

SLIDE 7

7

Test Driven Development

BDD SYMFONY TNrmed19

SLIDE 8

8

ComplexitésupplémentaireImpact de la conceptionOptimisation continueInvestissement entemps énormeINCONVENIENT DE LA TDD

BDD SYMFONY TNrmed19

SLIDE 9

9

Behaviour-driven development isabout implementing an applicationby describing its behaviour fromthe perspective of its stakeholders

DAN        NORTH

BDD SYMFONY TNrmed19

SLIDE 10

10

BDD est un méthode agile quiencourage la collaboration entreles développeurs, les responsablesqualités, les intervenants non-techniques et les entreprisesparticipant à un projet de logiciel.

BDD est motivée par la valeurcommerciale, c'est un avantagepour l'entreprise qui revient unefois que l'application est enproduction.

WIKIPEDIA

BDD SYMFONY TNrmed19

SLIDE 11

11

PROCESSUSBDD

Le code créé est àl’image de lademande del’utilisateur.

La fonctionnalité està l’image de lademande del’utilisateur.

Une grande qualitéde production.

On utilise desphrases, dans lalangue du projet.

On parle de besoinet non de solution,dans un langagenon technique.

On utilise destermes provenantdu langageomniprésentpartagé par tous.

BDD SYMFONY TNrmed19

SLIDE 12

12

  Fonctionnalité 2  Fonctionnalité

                                                                      

Scénario2-1

  Scénario 2-2  Scénario

1-1  Scénario 1-2  

Scénario1-3

 

BDD ça ressemble à quoi ?

BDD SYMFONY TNrmed19

SLIDE 13

13

BDD ça ressemble à quoi ?

Feature : TitleAs a (En tant que) ContexteI want (Je souhaite) FonctionnalitéIn order (Pour) Finalité

Scenario : Title (^(can|can not))Given (Je mets en place un contexte)When (Je procède à l’action, un événement, …)Then (Je vérifie)

GHERKIN

BDD SYMFONY TNrmed19

SLIDE 14

14

BDD ça ressemble à quoi ?Feature : Managing Blog Posts

As a webmasterI want I need to be able to create, view, edit or delete a postIn order to manage my blog content

Scenario : I can see all posts

Given I go to "/admin/post" pageThen I should see "Post List" And I should see "Add Post"

BDD SYMFONY TNrmed19

SLIDE 15

15

CONCLUANT•

Évolution et non une Révolution.

Tout le monde communique.

Réflexion approfondie.

Documentation testable.

Time is Money.

BDD SYMFONY TNrmed19

SLIDE 16

16

EXECUTE BDD

Passons à l'action

BDD SYMFONY TNrmed19

SLIDE 17

17

OUTILSBEHAT MINK

PHSPEC

BDD SYMFONY TNrmed19

SLIDE 18

18

CONFIGURATION "require-dev": {

 "sensio/generator-bundle": "~2.3", "phpspec/phpspec": "~2.0", "behat/behat": "2.4.*@stable", "behat/mink": "1.4.*@stable", "behat/mink-extension": "*","behat/symfony2-extension": "*","behat/mink-browserkit-driver": "*","behat/mink-selenium2-driver": "*"

 },

BDD SYMFONY TNrmed19

SLIDE 19

19

CONFIGURATION#behat.yml default:

paths: features: features bootstrap: %behat.paths.features%/bootstrap

extensions: Behat\MinkExtension\Extension: 

base_url: 'http://sftn.dev/app_dev.php'default_session: 'symfony2'

Behat\Symfony2Extension\Extension:mink_driver: true

BDD SYMFONY TNrmed19

SLIDE 20

20

CONFIGURATION

BDD SYMFONY TNrmed19

SLIDE 21

21

STORY DDFeature: Managing Blog Posts

In order to manage blog postsAs a blog administratorI need to be able to create, view, edit or delete posts

Scenario: Listing Blog Posts Given I go to "/post"Then I should see "Post List"And I should see "Add Post"

BDD SYMFONY TNrmed19

SLIDE 22

22

SPEC DD

BDD SYMFONY TNrmed19

SLIDE 23

23

SPEC DD

BDD SYMFONY TNrmed19

SLIDE 24

24

SPEC DD

BDD SYMFONY TNrmed19

SLIDE 25

25

THE END

top related