SlideShare a Scribd company logo
1 of 24
Applying modern software
development techniques to UI
          testing
Ultimate Software: Mission Statement




To provide United States and Canadian
businesses with 200 or more employees the
highest quality, most complete, and well-integrated
suite of strategic human resources, payroll, and
talent management solutions.




                                                      2
Who we Are

Michael Longin – Ultimate Software
    Software Engineer
    Certified Scrum Master
    Project Lead - SWAT



Christopher Taylor – Ultimate Software
    QA Automation/Tester
    Certified Scrum Master




                                         3
Tools we will use



SWAT
– Simple Web Automation Toolkit
– http://ulti-swat.wiki.sourceforge.net/
Fitnesse
– Wiki based requirements test tool
– www.fitnesse.org
Both are open source and can be used either
together or stand alone
Goals for this session



Attendees should be able to apply modern
software development techniques to UI testing
to create more agile and resilient tests and
improve overall quality.

“Automated testing done right is Software
Development”
– Elfriede Dustin and Marcus Borch @ GTAC 2008
Syllabus



•   Why we do UI testing
•   What is wrong with the recordplayback
    technique
•   Introduction to example project
•   Applying Test First Development
•   Refactoring
•   Pair testing
•   Compare our way vs. the “old way”
Why we do UI testing



All the way through
–   Through the product
–   Through the layers
–   Its truly how the user will use your system
–   100% Functional
Record-Playback technique failures


• Brittle
   – Easily broken when features change, even
     when the feature is not part of the test
• Very hard to update without re-recording
• Not Agile
   – Can only be done when code is complete
• Only tests what you record and not what
  you expect
• Time consuming because of the above
• Hard to read and understand
Our User



Name: JB
Occupation: Midlevel government employee
Skills:
– Web browsing
– Word
– Excel
User Story #1 : Login



As a user I want to provide my username and
password to login
Conditions of Satisfaction
– Login and Password boxes are present
– Title should read “M&C Life Insurance”
– Valid Login should lead to homepage
  • Example Login: jbauerpassword
– Homepage should read “Welcome”
User Story 2:View My Name



As a user I want to be welcomed by my name
after I login
Conditions of Satisfaction
– My first and last name are correct
– Title should read “Welcome ‘first name’ ‘last name’”
   • Example: Welcome Jack Bauer
User Story 3:Change My Name



As a user I want to be able to update my name
Conditions of Satisfaction
– I should get to the page by a menu located on the
  home page
– There should be a first name and last name text box
  on the screen
– Pressing save should bring me back to the homepage
Applying TFD


Test can be written before the feature
Allows parallel effort of development and automation
Turns vertical slicing into completed automation
Starts with well written conditions of satisfaction
Consistent naming standards are key
–   txb -> Textbox
–   btn -> Button
–   lbl -> Label
–   *if naming is wrong, can be easily updated
If the developer writes the automation, becomes almost
a UI TDD
Applying TFD continued



Example User Story #1
– Title should read “M&C Life Insurance”
   • Title means an H2
   • Text reads: “M&C Life Insurance”
– Login and Password boxes are present
   • 2 text boxes
   • Login - >txbLogin
   • Password -> txbPassword
   • Login Button -> btnLogin
Applying TFD continued



  Example Automation Code
|AssertElementExists|expression|innerhtml:M.C Life Insurance|h2|
|SetElementAttribute|Id|txbLogin|value|jbauer|input|
|SetElementAttribute|Id|txbPassword|value|password|input|
|StimulateElement|Id|btnLogin|onclick|input|
|AssertElementExists|Expression|innerHtml:welcome|
TFD Demo



Demo:
Refactoring


Why refactor
–   Less time to write automation
–   Less maintenance
–   Creates reusable code
–   Creates a domain specific language
What is refactoring
– For our purposes
   • Turn frequently used blocks of code into single line reusable
     entities
   • Use variables to make tests more robust
   • Creates an easily readable test by using English named
     functions
Refactoring continued



Allows tests to be easily updated if core features
change
– If login changed for example, only one update needed
Allows those beginning to write tests to take
advantage of previously created work
Makes tests much easier to read and debug
Refactoring continued
   Example:
|OpenBrowser|
|NavigateBrowser|www.m&cinsurance.com|
|SetElementAttribute|Id|txbLogin|value|${userName}|input|
|SetElementAttribute|Id|txbPassword|value|${password}|input|
|StimulateElement|Id|btnLogin|onclick|input|


   Becomes:
!define loginUserName (jbauer)
!define loginPassword (password)
!include .Macros.Login

   Example:
Refactoring Demo



Demo:
Pair Testing


Benefits rival those of Pair Programming
–   http://en.wikipedia.org/wiki/Pair_programming#Benefits
    • (Yes we did infact just site wikipedia)
Can be very effective for both writing automation and
locating missing requirements
Two heads are always better then one
While automating you can also accomplish exploratory
testing
Can replace manual testing phase with the creation of
automation
Compare 2nd test example vs a “recorded
        version of the same test”


Unreadable
Unorganized
Not useable as documentation (concept of
testable documentation)
Where to get help


Questions
– SWAT:
    • http://sourceforge.net/forum/?group_id=199701
– Fitnesse:
    • http://tech.groups.yahoo.com/group/fitnesse/?v=1&t=search&ch=we
      b&pub=groups&sec=group&slk=2
– Email
    • michael_longin@ultimatesoftware.com
    • christopher_taylor@ultimatesoftware.com
– Blogs
    • devXero.wordpress.com
    • www.agile-tester.com
Websites
– http://www.fitnesse.org/
– http://ulti-swat.wiki.sourceforge.net/
Questions



Questions????

More Related Content

What's hot

Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction SheetvodQA
 
BDD approach with Selenium RC
BDD approach with Selenium RCBDD approach with Selenium RC
BDD approach with Selenium RCMykola Kolisnyk
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...KMS Technology
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Mindfire Solutions
 
Test Driven Development in CQ5/AEM
Test Driven Development in CQ5/AEMTest Driven Development in CQ5/AEM
Test Driven Development in CQ5/AEMSagar Sane
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautifulMeaghan Lewis
 
Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object PatternDante Briones
 
Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15Tabăra de Testare
 
Cucumber From the Ground Up - Joseph Beale
Cucumber From the Ground Up - Joseph BealeCucumber From the Ground Up - Joseph Beale
Cucumber From the Ground Up - Joseph BealeQA or the Highway
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?QATestLab
 
Cypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests courseCypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests courseNarayanan Palani
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumLiraz Shay
 
Software Engineering
Software EngineeringSoftware Engineering
Software EngineeringMohamed Essam
 

What's hot (20)

Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
 
ASP.NET & Unit Testing
ASP.NET & Unit TestingASP.NET & Unit Testing
ASP.NET & Unit Testing
 
BDD approach with Selenium RC
BDD approach with Selenium RCBDD approach with Selenium RC
BDD approach with Selenium RC
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Codeception
CodeceptionCodeception
Codeception
 
Cucumber & gherkin language
Cucumber & gherkin languageCucumber & gherkin language
Cucumber & gherkin language
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
Bdd and spec flow
Bdd and spec flowBdd and spec flow
Bdd and spec flow
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
 
Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)Test Automation Framework using Cucumber BDD overview (part 1)
Test Automation Framework using Cucumber BDD overview (part 1)
 
Test Driven Development in CQ5/AEM
Test Driven Development in CQ5/AEMTest Driven Development in CQ5/AEM
Test Driven Development in CQ5/AEM
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautiful
 
Using The Page Object Pattern
Using The Page Object PatternUsing The Page Object Pattern
Using The Page Object Pattern
 
Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15Behavior Driven Development - TdT@Cluj #15
Behavior Driven Development - TdT@Cluj #15
 
Cucumber From the Ground Up - Joseph Beale
Cucumber From the Ground Up - Joseph BealeCucumber From the Ground Up - Joseph Beale
Cucumber From the Ground Up - Joseph Beale
 
What Is Cucumber?
What Is Cucumber?What Is Cucumber?
What Is Cucumber?
 
Cypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests courseCypress test techniques cucumber bdd framework,tdd,api tests course
Cypress test techniques cucumber bdd framework,tdd,api tests course
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
django
djangodjango
django
 

Similar to Applying modern software development techniques to UI testing

The Testing Planet Issue 2
The Testing Planet Issue 2The Testing Planet Issue 2
The Testing Planet Issue 2Rosie Sherry
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworksVishwanath KC
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyondmguillem
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development IntroductionNguyen Hai
 
#42 green lantern framework
#42   green lantern framework#42   green lantern framework
#42 green lantern frameworkSrilu Balla
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkSusannSgorzaly
 
Testing Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation FrameworksTesting Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation FrameworksŁukasz Morawski
 
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...AOE
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentZendCon
 
Automating Tests with Chrome DevTools Recorder
Automating Tests with Chrome DevTools RecorderAutomating Tests with Chrome DevTools Recorder
Automating Tests with Chrome DevTools RecorderApplitools
 
Пирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрияПирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрияSQALab
 
Test Pyramid vs Roi
Test Pyramid vs Roi Test Pyramid vs Roi
Test Pyramid vs Roi COMAQA.BY
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanJaehoon Oh
 
MCA-202-W4-L1.pptx
MCA-202-W4-L1.pptxMCA-202-W4-L1.pptx
MCA-202-W4-L1.pptxmanju451965
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven TestingHarish MS
 
Code Review
Code ReviewCode Review
Code ReviewRavi Raj
 
Bridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous DeliveryBridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous Deliverymasoodjan
 
Execute Automation Testing in 3 Steps
Execute Automation Testing in 3 StepsExecute Automation Testing in 3 Steps
Execute Automation Testing in 3 StepsExecuteAutomation
 

Similar to Applying modern software development techniques to UI testing (20)

The Testing Planet Issue 2
The Testing Planet Issue 2The Testing Planet Issue 2
The Testing Planet Issue 2
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworks
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development Introduction
 
#42 green lantern framework
#42   green lantern framework#42   green lantern framework
#42 green lantern framework
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP framework
 
Testing Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation FrameworksTesting Experience - Evolution of Test Automation Frameworks
Testing Experience - Evolution of Test Automation Frameworks
 
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
 
BDD Primer
BDD PrimerBDD Primer
BDD Primer
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Automating Tests with Chrome DevTools Recorder
Automating Tests with Chrome DevTools RecorderAutomating Tests with Chrome DevTools Recorder
Automating Tests with Chrome DevTools Recorder
 
Пирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрияПирамида Тестирования через призму ROI калькулятора и прочая геометрия
Пирамида Тестирования через призму ROI калькулятора и прочая геометрия
 
Test Pyramid vs Roi
Test Pyramid vs Roi Test Pyramid vs Roi
Test Pyramid vs Roi
 
C Sharp Cornerarticle
C Sharp CornerarticleC Sharp Cornerarticle
C Sharp Cornerarticle
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsman
 
MCA-202-W4-L1.pptx
MCA-202-W4-L1.pptxMCA-202-W4-L1.pptx
MCA-202-W4-L1.pptx
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
 
Code Review
Code ReviewCode Review
Code Review
 
Bridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous DeliveryBridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous Delivery
 
Execute Automation Testing in 3 Steps
Execute Automation Testing in 3 StepsExecute Automation Testing in 3 Steps
Execute Automation Testing in 3 Steps
 

Applying modern software development techniques to UI testing

  • 1. Applying modern software development techniques to UI testing
  • 2. Ultimate Software: Mission Statement To provide United States and Canadian businesses with 200 or more employees the highest quality, most complete, and well-integrated suite of strategic human resources, payroll, and talent management solutions. 2
  • 3. Who we Are Michael Longin – Ultimate Software Software Engineer Certified Scrum Master Project Lead - SWAT Christopher Taylor – Ultimate Software QA Automation/Tester Certified Scrum Master 3
  • 4. Tools we will use SWAT – Simple Web Automation Toolkit – http://ulti-swat.wiki.sourceforge.net/ Fitnesse – Wiki based requirements test tool – www.fitnesse.org Both are open source and can be used either together or stand alone
  • 5. Goals for this session Attendees should be able to apply modern software development techniques to UI testing to create more agile and resilient tests and improve overall quality. “Automated testing done right is Software Development” – Elfriede Dustin and Marcus Borch @ GTAC 2008
  • 6. Syllabus • Why we do UI testing • What is wrong with the recordplayback technique • Introduction to example project • Applying Test First Development • Refactoring • Pair testing • Compare our way vs. the “old way”
  • 7. Why we do UI testing All the way through – Through the product – Through the layers – Its truly how the user will use your system – 100% Functional
  • 8. Record-Playback technique failures • Brittle – Easily broken when features change, even when the feature is not part of the test • Very hard to update without re-recording • Not Agile – Can only be done when code is complete • Only tests what you record and not what you expect • Time consuming because of the above • Hard to read and understand
  • 9. Our User Name: JB Occupation: Midlevel government employee Skills: – Web browsing – Word – Excel
  • 10. User Story #1 : Login As a user I want to provide my username and password to login Conditions of Satisfaction – Login and Password boxes are present – Title should read “M&C Life Insurance” – Valid Login should lead to homepage • Example Login: jbauerpassword – Homepage should read “Welcome”
  • 11. User Story 2:View My Name As a user I want to be welcomed by my name after I login Conditions of Satisfaction – My first and last name are correct – Title should read “Welcome ‘first name’ ‘last name’” • Example: Welcome Jack Bauer
  • 12. User Story 3:Change My Name As a user I want to be able to update my name Conditions of Satisfaction – I should get to the page by a menu located on the home page – There should be a first name and last name text box on the screen – Pressing save should bring me back to the homepage
  • 13. Applying TFD Test can be written before the feature Allows parallel effort of development and automation Turns vertical slicing into completed automation Starts with well written conditions of satisfaction Consistent naming standards are key – txb -> Textbox – btn -> Button – lbl -> Label – *if naming is wrong, can be easily updated If the developer writes the automation, becomes almost a UI TDD
  • 14. Applying TFD continued Example User Story #1 – Title should read “M&C Life Insurance” • Title means an H2 • Text reads: “M&C Life Insurance” – Login and Password boxes are present • 2 text boxes • Login - >txbLogin • Password -> txbPassword • Login Button -> btnLogin
  • 15. Applying TFD continued Example Automation Code |AssertElementExists|expression|innerhtml:M.C Life Insurance|h2| |SetElementAttribute|Id|txbLogin|value|jbauer|input| |SetElementAttribute|Id|txbPassword|value|password|input| |StimulateElement|Id|btnLogin|onclick|input| |AssertElementExists|Expression|innerHtml:welcome|
  • 17. Refactoring Why refactor – Less time to write automation – Less maintenance – Creates reusable code – Creates a domain specific language What is refactoring – For our purposes • Turn frequently used blocks of code into single line reusable entities • Use variables to make tests more robust • Creates an easily readable test by using English named functions
  • 18. Refactoring continued Allows tests to be easily updated if core features change – If login changed for example, only one update needed Allows those beginning to write tests to take advantage of previously created work Makes tests much easier to read and debug
  • 19. Refactoring continued Example: |OpenBrowser| |NavigateBrowser|www.m&cinsurance.com| |SetElementAttribute|Id|txbLogin|value|${userName}|input| |SetElementAttribute|Id|txbPassword|value|${password}|input| |StimulateElement|Id|btnLogin|onclick|input| Becomes: !define loginUserName (jbauer) !define loginPassword (password) !include .Macros.Login Example:
  • 21. Pair Testing Benefits rival those of Pair Programming – http://en.wikipedia.org/wiki/Pair_programming#Benefits • (Yes we did infact just site wikipedia) Can be very effective for both writing automation and locating missing requirements Two heads are always better then one While automating you can also accomplish exploratory testing Can replace manual testing phase with the creation of automation
  • 22. Compare 2nd test example vs a “recorded version of the same test” Unreadable Unorganized Not useable as documentation (concept of testable documentation)
  • 23. Where to get help Questions – SWAT: • http://sourceforge.net/forum/?group_id=199701 – Fitnesse: • http://tech.groups.yahoo.com/group/fitnesse/?v=1&t=search&ch=we b&pub=groups&sec=group&slk=2 – Email • michael_longin@ultimatesoftware.com • christopher_taylor@ultimatesoftware.com – Blogs • devXero.wordpress.com • www.agile-tester.com Websites – http://www.fitnesse.org/ – http://ulti-swat.wiki.sourceforge.net/