Functional Testing
@cvences
Thursday, April 24, 14
About Me
• CarlosVences
• carlos@semantic.mx
• WebOps Engineer @ Semantic Weapons
• 12+ yo experienced troublemaker
• #Dru...
TDD Quick Intro
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Test, test, test...
• Product Backlog
• Poker Planning
• User Stories!
• Acceptance Criteria
• Task Estimation
http://sema...
Test Automation
• Decoupling!
• Mocks define
expectations
• Stubs replace behavior
• I&T
• Verification &Validation
• System...
Why?
• Best Test Coverage
• Mimics Functional QA
• Write against client approved User Stories
http://semantic.mx SymfonyDa...
Symfony2
Functional Testing
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
• Test URL’s
• Assert on HTTP
responses
• extends WebTestCase
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Behavior Driven Development
Let’s Spice it up!
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Behat Extension
• Describes a feature
• Can be estimated
• Inspired by Cucumber &
Gherkin
• Feature, Scenario,
Conditions
...
Behat Scenarios
• Given [Initial context]
• And [initial state]
• When [Action]
• Then [Result]
http://semantic.mx Symfony...
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Epic Fail!
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Tools
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Tools
• BrowserKit
• Guzzle HTTP client
• DOM Crawler
• XPath
• TestComplete
• Gherkin
• Mink
• Selenium
• Watir
http://se...
Hints
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Hints
http://semantic.mx SymfonyDay DF, 2014
• followRedirect
• Test DOM notVisual
Designs
• In memory SQLite
• Shared DB ...
Thanks!
Do nothing until you test first!
carlos@semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Upcoming SlideShare
Loading in …5
×

Functional Testing - Carlos Vences

364 views
347 views

Published on

Functional Testing for Symfony2

Published in: Software, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
364
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

×