Successfully reported this slideshow.
Your SlideShare is downloading. ×

Full stack BDD for Symfony2

Full stack BDD for Symfony2

Download to read offline

Many Symfony2 developers have heard about Behat and even use it regularly in their Symfony projects. If you have found value in this tool and the BDD practices it was inspired on, come join us for this talk as we will expand on what other benefits these practices and other BDD tools available can bring. This very illustrative talk will not only present you with the tools but show how to use them together to build beautifully architected, business-oriented Symfony2 applications.

Many Symfony2 developers have heard about Behat and even use it regularly in their Symfony projects. If you have found value in this tool and the BDD practices it was inspired on, come join us for this talk as we will expand on what other benefits these practices and other BDD tools available can bring. This very illustrative talk will not only present you with the tools but show how to use them together to build beautifully architected, business-oriented Symfony2 applications.

More Related Content

Related Books

Free with a 30 day trial from Scribd

See all

Full stack BDD for Symfony2

  1. 1. Full Stack BDD for Symfony2 Marcello Duarte Konstantin Kudryashov
  2. 2. About us Marcello Duarte Head of Training Konstantin Kudryashov Lead Developer
  3. 3. This talk • Where are we coming from • Why BDD • Behat Best Practices • Introducing a new tool
  4. 4. from Cucumber to
  5. 5. Adults don’t think their way into a new way of acting
  6. 6. Adults don’t think their way into a new way of acting They act their way into a new way of thinking
  7. 7. Ask Why
  8. 8. from xUnit to xSpec HP S pec P
  9. 9. ? ? ? ? ? ? ? ? Test ? ? ? ? ? ? ? ? ? ?
  10. 10. code coverage private xUnit database mocking assert structure
  11. 11. Language matter
  12. 12. public function testUpdateWithEqualTypes() { $installer = $this->createInstallerMock(); $manager = new InstallationManager('vendor'); $manager->addInstaller($installer); $initial = $this->createPackageMock(); $target = $this->createPackageMock(); $operation = new UpdateOperation($initial, $target, 'test'); $initial ->expects($this->once()) ->method('getType') ->will($this->returnValue('library')); $target ->expects($this->once()) ->method('getType') ->will($this->returnValue('library')); $installer ->expects($this->once()) ->method('supports') ->with('library') ->will($this->returnValue(true)); $installer ->expects($this->once()) ->method('update') ->with($this->repository, $initial, $target);
  13. 13. Tools matter
  14. 14. Why BDD?
  15. 15. Requirements Analysis Design Develop Test 9 months 3 months 2 months 12 months ... [Royce 1970]
  16. 16. Most of the cost in software development is in feedback delay
  17. 17. Requirements Acceptance Test Code Refactoring ~20 minutes [Beck & Cunningham 1996-99]
  18. 18. Let’s reduce feedback delay
  19. 19. Let’s rename a few things
  20. 20. Narratives (Why?) Examples (What do you mean?) Describe Object How! Implement Incremental Design [North 03]
  21. 21. Building a simple Student can enrol on a course feature
  22. 22. You can follow our steps http://git.io/t4kQ5Q
  23. 23. BDD Rules • No examples until you have a red step • No code until you have a red example • No more code than enough to make it green • Don’t get carried away!
  24. 24. Behat tips • Favour MinkAwareInterface over MinkContext • Extract context per role • Group features under feature folder • Use Mink API • Integrate with framework at config level
  25. 25. PHPSpec2 tips • Describe classes not configuration • Concentrate on messages/behaviours
  26. 26. ? ? ? ? ? ? ? ?Questions ? ? ? ? ? ? ? ? ? ?
  27. 27. joind.in/7064 Thanks! :)

×