44 Accepted by M. Vences: 21 Dec. 2011; published: 2 Mar. 2012 ...
Functional Testing - Carlos Vences
-
Upload
carlos-vences -
Category
Software
-
view
274 -
download
2
description
Transcript of Functional Testing - Carlos Vences
Functional Testing@cvences
Thursday, April 24, 14
About Me
• Carlos Vences
• WebOps Engineer @ Semantic Weapons
• 12+ yo experienced troublemaker
• #DrupalCampMX #dcmx14 #SymfonyDay
Thursday, April 24, 14
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://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
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
Why?
• Best Test Coverage
• Mimics Functional QA
• Write against client approved User Stories
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
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 DevelopmentLet’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
• In Order to [BV]
• As a [Role]
• I need to [Feature]
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Behat Scenarios• Given [Initial context]
• And [initial state]
• When [Action]
• Then [Result]
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://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Hints
http://semantic.mx SymfonyDay DF, 2014
Thursday, April 24, 14
Hints
http://semantic.mx SymfonyDay DF, 2014
• followRedirect
• Test DOM not Visual Designs
• In memory SQLite
• Shared DB connection
• DBUnit
• More Setup less TearDown
• Authentication
Thursday, April 24, 14
Thanks!Do nothing until you test first!
[email protected] SymfonyDay DF, 2014
Thursday, April 24, 14