Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Functional Testing - Carlos Vences

464 views

Published on

Functional Testing for Symfony2

Published in: Software, Technology
  • Be the first to comment

  • Be the first to like this

Functional Testing - Carlos Vences

  1. 1. Functional Testing @cvences Thursday, April 24, 14
  2. 2. About Me • CarlosVences • carlos@semantic.mx • WebOps Engineer @ Semantic Weapons • 12+ yo experienced troublemaker • #DrupalCampMX #dcmx14 #SymfonyDay Thursday, April 24, 14
  3. 3. TDD Quick Intro http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  4. 4. Test, test, test... • Product Backlog • Poker Planning • User Stories! • Acceptance Criteria • Task Estimation http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  5. 5. Test Automation • Decoupling! • Mocks define expectations • Stubs replace behavior • I&T • Verification &Validation • System Testing • ...validates against requirements • Describes what the system does... • ...verifies against specification http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  6. 6. Why? • Best Test Coverage • Mimics Functional QA • Write against client approved User Stories http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  7. 7. Symfony2 Functional Testing http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  8. 8. • Test URL’s • Assert on HTTP responses • extends WebTestCase http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  9. 9. Behavior Driven Development Let’s Spice it up! http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  10. 10. Behat Extension • Describes a feature • Can be estimated • Inspired by Cucumber & Gherkin • Feature, Scenario, Conditions • In Order to [BV] • As a [Role] • I need to [Feature] http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  11. 11. Behat Scenarios • Given [Initial context] • And [initial state] • When [Action] • Then [Result] http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  12. 12. http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  13. 13. http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  14. 14. http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  15. 15. Epic Fail! http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  16. 16. Tools http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  17. 17. Tools • BrowserKit • Guzzle HTTP client • DOM Crawler • XPath • TestComplete • Gherkin • Mink • Selenium • Watir http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  18. 18. Hints http://semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14
  19. 19. Hints http://semantic.mx SymfonyDay DF, 2014 • followRedirect • Test DOM notVisual Designs • In memory SQLite • Shared DB connection • DBUnit • More Setup less TearDown • Authentication Thursday, April 24, 14
  20. 20. Thanks! Do nothing until you test first! carlos@semantic.mx SymfonyDay DF, 2014 Thursday, April 24, 14

×