SlideShare a Scribd company logo
An introduction to

                   Test Automation




© Copyright Pekka Klärck <peke@eliga.fi>
Creative Commons Attribution 3.0 License
Scope
●   Dynamic vs. static
●   Functional vs. non-functional
●   Acceptance vs. unit (vs. module vs. integration)
●   Frameworks vs. drivers
●   Running tests vs. generating tests
●   Full scale automation vs. helping manual
    testing
●   Test execution vs. test management
Different scripting approaches
●   Record and playback
●   Linear scripting
●   Modular scripting
●   Data-driven testing
●   Keyword-driven testing
Record and playback
●   Capture interaction with system and replay it
●   Popular approach among commercial tools
Record and playback: Example




Selenium IDE
Record and playback: Benefits
●   Very easy and fast to create initially
●   No programming skills needed
Record and playback: Problems
●   Does not test anything unless checkpoints added
●   Very fragile
    ●   Often single change in UI can break all tests
●   Hard to maintain
    ●   Plenty of separate test scripts
    ●   No modularity or reuse
●   System must be ready before automation can start
    ●   Does not support acceptance test driven development (ATDD)
Record and playback: Summary
●   Seldom a good approach in general
●   Never a good basis for large scale automation
Linear scripting
●   Non-structured scripts interact directly with the
    system under test (SUT)
●   Can use any programming language
●   Also produced by capture and replay tools
Linear scripting: Example




Selenium RC Python API
Linear scripting: Benefits
●   Fast to create initially
●   Flexible
●   Can use common scripting languages
    ●   No license costs
Linear scripting: Problems
●   Creating tests requires programming skills
●   Very fragile
    ●   One change in the system may break all scripts
●   Hard to maintain
    ●   Plenty of test scripts
    ●   No modularity or reuse
Linear scripting: Summary
●   Adequate for simple tasks
●   Never a good basis for large scale automation
Modular scripting
●   Driver scripts “drive” test execution
●   Interaction with the SUT done by functions in a
    test library
Modular scripting: Example
                 ← Test library

                 ↓ Driver script
Modular scripting: Benefits
●   Reuse of code
    ●   Creating new tests gets faster
●   Maintainability
    ●   Changes require fixes in smaller areas
●   Driver scripts are simple
    ●   Even novice programmers can understand and edit
    ●   Creating new ones is not hard either
Modular scripting: Problems
●   Building test library requires initial effort
    ●   Takes time
    ●   Requires programming skills
●   Test data embedded into scripts
    ●   Requires some understanding of programming
●   New tests require new driver scripts
Modular scripting: Summary
●   Good for simple tasks
●   Works also in larger usage if everyone who
    needs to understand tests can program
●   Not good for non-programmers
Data-driven testing
●   Test data taken out of test scripts
    ●   Customarily presented in tabular format
●   One driver script can execute multiple similar tests
●   New driver script still needed for different kinds of tests
Data-driven testing: Example
Data-driven testing: Benefits
●   Test libraries provide modularity
    ●   Same benefits as with modular scripting
●   Creating and editing existing tests is very easy
    ●   No programming skills needed
●   Maintenance responsibilities can be divided
    ●   Testers are responsible for the test data
    ●   Programmers are responsible for automation code
Data-driven testing: Problems
●   Test cases are similar
    ●   For example '1 + 2 = 3' and '1 * 2 = 2'
●   New kinds of tests need new driver script
    ●   For example '1 * 2 + 3 = 6'
    ●   Creating driver scripts requires programming skills
●   Initial effort creating parsers and other reusable
    components can be big
Data-driven testing: Summary
●   Good solution even for larger scale use
●   New kinds of tests requiring programming is a
    minus
●   May be an overkill for simple needs
Keyword-driven testing
●   Not only test data but also directives (keywords)
    telling how to use the data taken out of the test
    scripts
●   Keywords and the test data associated with them
    drive test execution
Keyword-driven testing: Example




Robot Framework syntax from SeleniumLibrary demo:
http://bit.ly/rf-web-test-demo
Keyword-driven testing: Benefits
●   All same benefits as with data-driven testing
    ●   Non-programmers can create and edit tests
    ●   Separation of test data and code
●   Tests can be constructed freely from keywords
    ●   Non-programmers can create also new kinds of tests
    ●   With suitable keywords also data-driven tests possible
●   All tests can be executed by one framework
    ●   No need to create and maintain separate driver scripts
Keyword-driven testing: Problems
●   Initial effort can be really big
    ●   But there are open source solutions available!
Keyword-driven testing: Summary
●   Very good solution for large scale use
●   Use existing solutions if you can
●   May be an overkill for simple needs
Interacting with the SUT
●   Testability
●   Testing through GUI
●   Testing below GUI
●   Other interfaces
Testability
●   The hardest part of automation is interacting
    with the system under test
    ●   Especially hard with GUIs
    ●   Programming APIs are easiest
●   Important to make the system easy to test
●   Some common guidelines
    ●   Add identifiers to GUI widgets
    ●   Textual outputs should be easy to parse
    ●   Consider providing automation interfaces
Testing through GUI
●   Same interface as normal users use
●   Can be technically challenging or impossible
    ●   Not all GUI technologies have good tools available
●   Often fragile tests
●   Often relative slow to execute
●   Good approach to use when feasible
Testing below GUI
●   Automating through business layer often easy
●   Tests typically run very fast
●   But you still need to test the GUI
    ●   Test the GUI is wired correctly to the business logic
    ●   GUIs always have some functionality of their own
●   Pragmatic hybrid solution:
    ●   Test overall functionality below the GUI
    ●   Some end-to-end tests through the GUI—not
        necessarily even automated
Other interfaces
●   Not all systems have a GUI
●   Many systems have multiple interfaces
    ●   Programming APIs, databases, server interfaces,
        command line, …
    ●   Automation framework which can utilize different
        drivers works well in these situations
●   Non-GUI interfaces generally easy to automate
    ●   Most of them targeted for machines
    ●   Test library is just another client
When to automate and by whom?
●   After development by separate team
●   During development collaboratively
Automation after development
●   Often by different team
    ●   In worst case on a different floor, building, or continent
    ●   Communication problems
●   Typical in waterfall-ish projects
●   Slow feedback loop
●   Testability problems can be show stoppers
    ●   Often hard to get testability hooks added afterwards
    ●   May need to resort to complicated and fragile solutions
Collaborative automation
●   Automation considered an integral part of
    development
    ●   Collaboration between testers and programmers
●   Typical in Agile projects
    ●   In acceptance test driven development (ATDD)
        automation started before implementation
●   Testability normally not a problem
    ●   Programmers can create testability hooks
    ●   Testability and available tooling can be taken into
        account even with technology decisions
Supporting practices
●   Version control
●   Continuous integration
Version control
●   Test data and code should be stored the same
    way as production code
●   Recommended to store tests with the
    production code
    ●   Easy to get an old version of the software with
        related tests
●   Lot of great open source alternatives available
    ●   Subversion, Git, Mercurial, …
    ●   No excuse not to use
Continuous integration
●   Key to full scale automation
●   Tests are run automatically when
    ●   New tests are added
    ●   Code is changed
●   Can also have scheduled test runs
    ●   Useful if running all tests takes time
●   Great open source solutions available
    ●   Jenkins/Hudson, Cruise Control, BuildBot, …
    ●   Custom scripts and cron jobs can be retired
Available tools
●   Commercial
●   Open source
●   Freeware
Commercial tools
●   Good ones tend to be expensive
    ●   But not all expensive are good
    ●   Even cheap licenses can prevent full team collaboration
●   Often hard to integrate with
    ●   Other automation tools (especially from other vendors)
    ●   Version control and continuous integration
●   Hard or impossible to customize
●   Risk of product or company discontinuation
Open source tools
●   Large variety
    ●   Some are great—others not so
●   Normally easy to integrate with other tools
●   Free, as in beer, is good
    ●   Everyone can use freely
●   Free, as in speech, is good
    ●   Can be customize freely
    ●   Can never really die
Freeware tools
●   Getting rare nowadays
    ●   Most free tools are also open source
●   No license costs
●   Tend to be easier to integrate with other tools
    than commercial
●   Hard or impossible to customize
●   Risk of discontinuation
Generic skills to learn
●   Scripting languages
    ●   Python, Ruby, Perl, Javascript, ...
●   Regular expressions
    ●   A must when parsing textual outputs
●   XPath and CSS selectors
    ●   A must when doing web testing
●   SQL
    ●   A must with databases
●   Using version control
Is manual testing still needed?
●   YES!!
●   Avoid scripted manual testing
    ●   Automate it instead
●   Concentrate on exploratory testing
    ●   Machines are great for running regression tests
    ●   Humans are great for finding new defects
Questions?
                             Thanks!



© Copyright Pekka Klärck <peke@eliga.fi>
Creative Commons Attribution 3.0 License

More Related Content

What's hot

Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
Ken McCorkell
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
Keytorc Software Testing Services
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
Edureka!
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
Directi Group
 
Agile Testing
Agile Testing Agile Testing
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
Knoldus Inc.
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
Sauce Labs
 
Building a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessBuilding a Test Automation Strategy for Success
Building a Test Automation Strategy for Success
Lee Barnes
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planningSivaprasanthRentala1975
 
Test automation
Test automationTest automation
Test automation
Xavier Yin
 
Test Automation Strategy
Test Automation StrategyTest Automation Strategy
Test Automation StrategyMartin Ruddy
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Test automation process
Test automation processTest automation process
Test automation process
Bharathi Krishnamurthi
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategytharindakasun
 
Gatling overview
Gatling overviewGatling overview
Gatling overview
Viral Jain
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
Pekka Klärck
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
Somkiat Puisungnoen
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
Sun Technlogies
 
Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecture
rohitnayak
 

What's hot (20)

Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Agile Testing
Agile Testing Agile Testing
Agile Testing
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Building a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessBuilding a Test Automation Strategy for Success
Building a Test Automation Strategy for Success
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Test automation
Test automationTest automation
Test automation
 
Test Automation Strategy
Test Automation StrategyTest Automation Strategy
Test Automation Strategy
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
Test automation process
Test automation processTest automation process
Test automation process
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategy
 
Gatling overview
Gatling overviewGatling overview
Gatling overview
 
Automation testing
Automation testingAutomation testing
Automation testing
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecture
 

Viewers also liked

Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Anirudh Raja
 
Introduction to Gauge
Introduction to GaugeIntroduction to Gauge
Introduction to Gauge
vodqancr
 
Create the Future - Innovations in Testing
Create the Future - Innovations in TestingCreate the Future - Innovations in Testing
Create the Future - Innovations in Testing
Anand Bagmar
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
Hai Tran Son
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
vodQA
 
ICT for Automotive Industry
ICT for Automotive IndustryICT for Automotive Industry
ICT for Automotive IndustryInterlatin
 
Learning's from mobile testing
Learning's from mobile testingLearning's from mobile testing
Learning's from mobile testing
Vikrant Chauhan
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
Archana Krushnan
 
13 Test Automation Practices You Should be Afraid Of
13 Test Automation Practices You Should be Afraid Of13 Test Automation Practices You Should be Afraid Of
13 Test Automation Practices You Should be Afraid Of
Joe Colantonio
 
Arjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation WheelsArjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation Wheels
Rahul Verma
 
Specifications test automation pyramid public
Specifications test automation pyramid   publicSpecifications test automation pyramid   public
Specifications test automation pyramid public
Sathyan Sethumadhavan
 
Say NO To (More) Selenium Tests
Say NO To (More) Selenium TestsSay NO To (More) Selenium Tests
Say NO To (More) Selenium Tests
Anand Bagmar
 
Need for automation testing
Need for automation testingNeed for automation testing
Need for automation testing
99tests
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
Heritage Institute Of Tech,India
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
Anand Bagmar
 
How to be an awesome test automation professional
How to be an awesome test automation professionalHow to be an awesome test automation professional
How to be an awesome test automation professional
Kushan Shalindra Amarasiri - Technical QE Specialist
 

Viewers also liked (18)

Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Automated Testing
Automated TestingAutomated Testing
Automated Testing
 
Introduction to Gauge
Introduction to GaugeIntroduction to Gauge
Introduction to Gauge
 
Create the Future - Innovations in Testing
Create the Future - Innovations in TestingCreate the Future - Innovations in Testing
Create the Future - Innovations in Testing
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
 
ICT for Automotive Industry
ICT for Automotive IndustryICT for Automotive Industry
ICT for Automotive Industry
 
Learning's from mobile testing
Learning's from mobile testingLearning's from mobile testing
Learning's from mobile testing
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
 
13 Test Automation Practices You Should be Afraid Of
13 Test Automation Practices You Should be Afraid Of13 Test Automation Practices You Should be Afraid Of
13 Test Automation Practices You Should be Afraid Of
 
Arjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation WheelsArjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation Wheels
 
Tw specifications for-testing1
Tw specifications for-testing1Tw specifications for-testing1
Tw specifications for-testing1
 
Specifications test automation pyramid public
Specifications test automation pyramid   publicSpecifications test automation pyramid   public
Specifications test automation pyramid public
 
Say NO To (More) Selenium Tests
Say NO To (More) Selenium TestsSay NO To (More) Selenium Tests
Say NO To (More) Selenium Tests
 
Need for automation testing
Need for automation testingNeed for automation testing
Need for automation testing
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
How to be an awesome test automation professional
How to be an awesome test automation professionalHow to be an awesome test automation professional
How to be an awesome test automation professional
 

Similar to Introduction to Test Automation

High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
Lars Thorup
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
Anatoliy Okhotnikov
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
Dr Ganesh Iyer
 
Test automation - Building effective solutions
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutions
Artem Nagornyi
 
Open Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up Intro
Skills Matter
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
Rogério Vicente
 
Wso2con test-automation
Wso2con test-automationWso2con test-automation
Wso2con test-automation
krishantha_samaraweera
 
Technical Practices for Agile Engineering - PNSQC 2019
Technical Practices for Agile Engineering - PNSQC 2019Technical Practices for Agile Engineering - PNSQC 2019
Technical Practices for Agile Engineering - PNSQC 2019
Moss Drake
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
Peter Kofler
 
Mobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / DemoMobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / Demo
TestingCR
 
Gatling
Gatling Gatling
Gatling
Gaurav Shukla
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
Knoldus Inc.
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
IBACZ
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not Guaranteed
Anna Royzman
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
Dave Cross
 
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
MobileMonday Estonia
 
Building Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software EngineeringBuilding Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software Engineering
Muhammad Shehata
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
JWORKS powered by Ordina
 
Quality Assurance: An Overview
Quality Assurance: An OverviewQuality Assurance: An Overview
Quality Assurance: An Overview
Anant Corporation
 

Similar to Introduction to Test Automation (20)

High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering Teams
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing Tools
 
Test automation - Building effective solutions
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutions
 
Open Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up Intro
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
 
Wso2con test-automation
Wso2con test-automationWso2con test-automation
Wso2con test-automation
 
Technical Practices for Agile Engineering - PNSQC 2019
Technical Practices for Agile Engineering - PNSQC 2019Technical Practices for Agile Engineering - PNSQC 2019
Technical Practices for Agile Engineering - PNSQC 2019
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
 
Mobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / DemoMobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / Demo
 
Gatling
Gatling Gatling
Gatling
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not Guaranteed
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
Front-end Testing (manual, automated, you name it) - Erich Jagomägis - Develo...
 
Building Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software EngineeringBuilding Sustainable Software: An Introduction to Software Engineering
Building Sustainable Software: An Introduction to Software Engineering
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
Quality Assurance: An Overview
Quality Assurance: An OverviewQuality Assurance: An Overview
Quality Assurance: An Overview
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

Introduction to Test Automation

  • 1. An introduction to Test Automation © Copyright Pekka Klärck <peke@eliga.fi> Creative Commons Attribution 3.0 License
  • 2. Scope ● Dynamic vs. static ● Functional vs. non-functional ● Acceptance vs. unit (vs. module vs. integration) ● Frameworks vs. drivers ● Running tests vs. generating tests ● Full scale automation vs. helping manual testing ● Test execution vs. test management
  • 3. Different scripting approaches ● Record and playback ● Linear scripting ● Modular scripting ● Data-driven testing ● Keyword-driven testing
  • 4. Record and playback ● Capture interaction with system and replay it ● Popular approach among commercial tools
  • 5. Record and playback: Example Selenium IDE
  • 6. Record and playback: Benefits ● Very easy and fast to create initially ● No programming skills needed
  • 7. Record and playback: Problems ● Does not test anything unless checkpoints added ● Very fragile ● Often single change in UI can break all tests ● Hard to maintain ● Plenty of separate test scripts ● No modularity or reuse ● System must be ready before automation can start ● Does not support acceptance test driven development (ATDD)
  • 8. Record and playback: Summary ● Seldom a good approach in general ● Never a good basis for large scale automation
  • 9. Linear scripting ● Non-structured scripts interact directly with the system under test (SUT) ● Can use any programming language ● Also produced by capture and replay tools
  • 11. Linear scripting: Benefits ● Fast to create initially ● Flexible ● Can use common scripting languages ● No license costs
  • 12. Linear scripting: Problems ● Creating tests requires programming skills ● Very fragile ● One change in the system may break all scripts ● Hard to maintain ● Plenty of test scripts ● No modularity or reuse
  • 13. Linear scripting: Summary ● Adequate for simple tasks ● Never a good basis for large scale automation
  • 14. Modular scripting ● Driver scripts “drive” test execution ● Interaction with the SUT done by functions in a test library
  • 15. Modular scripting: Example ← Test library ↓ Driver script
  • 16. Modular scripting: Benefits ● Reuse of code ● Creating new tests gets faster ● Maintainability ● Changes require fixes in smaller areas ● Driver scripts are simple ● Even novice programmers can understand and edit ● Creating new ones is not hard either
  • 17. Modular scripting: Problems ● Building test library requires initial effort ● Takes time ● Requires programming skills ● Test data embedded into scripts ● Requires some understanding of programming ● New tests require new driver scripts
  • 18. Modular scripting: Summary ● Good for simple tasks ● Works also in larger usage if everyone who needs to understand tests can program ● Not good for non-programmers
  • 19. Data-driven testing ● Test data taken out of test scripts ● Customarily presented in tabular format ● One driver script can execute multiple similar tests ● New driver script still needed for different kinds of tests
  • 21. Data-driven testing: Benefits ● Test libraries provide modularity ● Same benefits as with modular scripting ● Creating and editing existing tests is very easy ● No programming skills needed ● Maintenance responsibilities can be divided ● Testers are responsible for the test data ● Programmers are responsible for automation code
  • 22. Data-driven testing: Problems ● Test cases are similar ● For example '1 + 2 = 3' and '1 * 2 = 2' ● New kinds of tests need new driver script ● For example '1 * 2 + 3 = 6' ● Creating driver scripts requires programming skills ● Initial effort creating parsers and other reusable components can be big
  • 23. Data-driven testing: Summary ● Good solution even for larger scale use ● New kinds of tests requiring programming is a minus ● May be an overkill for simple needs
  • 24. Keyword-driven testing ● Not only test data but also directives (keywords) telling how to use the data taken out of the test scripts ● Keywords and the test data associated with them drive test execution
  • 25. Keyword-driven testing: Example Robot Framework syntax from SeleniumLibrary demo: http://bit.ly/rf-web-test-demo
  • 26. Keyword-driven testing: Benefits ● All same benefits as with data-driven testing ● Non-programmers can create and edit tests ● Separation of test data and code ● Tests can be constructed freely from keywords ● Non-programmers can create also new kinds of tests ● With suitable keywords also data-driven tests possible ● All tests can be executed by one framework ● No need to create and maintain separate driver scripts
  • 27. Keyword-driven testing: Problems ● Initial effort can be really big ● But there are open source solutions available!
  • 28. Keyword-driven testing: Summary ● Very good solution for large scale use ● Use existing solutions if you can ● May be an overkill for simple needs
  • 29. Interacting with the SUT ● Testability ● Testing through GUI ● Testing below GUI ● Other interfaces
  • 30. Testability ● The hardest part of automation is interacting with the system under test ● Especially hard with GUIs ● Programming APIs are easiest ● Important to make the system easy to test ● Some common guidelines ● Add identifiers to GUI widgets ● Textual outputs should be easy to parse ● Consider providing automation interfaces
  • 31. Testing through GUI ● Same interface as normal users use ● Can be technically challenging or impossible ● Not all GUI technologies have good tools available ● Often fragile tests ● Often relative slow to execute ● Good approach to use when feasible
  • 32. Testing below GUI ● Automating through business layer often easy ● Tests typically run very fast ● But you still need to test the GUI ● Test the GUI is wired correctly to the business logic ● GUIs always have some functionality of their own ● Pragmatic hybrid solution: ● Test overall functionality below the GUI ● Some end-to-end tests through the GUI—not necessarily even automated
  • 33. Other interfaces ● Not all systems have a GUI ● Many systems have multiple interfaces ● Programming APIs, databases, server interfaces, command line, … ● Automation framework which can utilize different drivers works well in these situations ● Non-GUI interfaces generally easy to automate ● Most of them targeted for machines ● Test library is just another client
  • 34. When to automate and by whom? ● After development by separate team ● During development collaboratively
  • 35. Automation after development ● Often by different team ● In worst case on a different floor, building, or continent ● Communication problems ● Typical in waterfall-ish projects ● Slow feedback loop ● Testability problems can be show stoppers ● Often hard to get testability hooks added afterwards ● May need to resort to complicated and fragile solutions
  • 36. Collaborative automation ● Automation considered an integral part of development ● Collaboration between testers and programmers ● Typical in Agile projects ● In acceptance test driven development (ATDD) automation started before implementation ● Testability normally not a problem ● Programmers can create testability hooks ● Testability and available tooling can be taken into account even with technology decisions
  • 37. Supporting practices ● Version control ● Continuous integration
  • 38. Version control ● Test data and code should be stored the same way as production code ● Recommended to store tests with the production code ● Easy to get an old version of the software with related tests ● Lot of great open source alternatives available ● Subversion, Git, Mercurial, … ● No excuse not to use
  • 39. Continuous integration ● Key to full scale automation ● Tests are run automatically when ● New tests are added ● Code is changed ● Can also have scheduled test runs ● Useful if running all tests takes time ● Great open source solutions available ● Jenkins/Hudson, Cruise Control, BuildBot, … ● Custom scripts and cron jobs can be retired
  • 40. Available tools ● Commercial ● Open source ● Freeware
  • 41. Commercial tools ● Good ones tend to be expensive ● But not all expensive are good ● Even cheap licenses can prevent full team collaboration ● Often hard to integrate with ● Other automation tools (especially from other vendors) ● Version control and continuous integration ● Hard or impossible to customize ● Risk of product or company discontinuation
  • 42. Open source tools ● Large variety ● Some are great—others not so ● Normally easy to integrate with other tools ● Free, as in beer, is good ● Everyone can use freely ● Free, as in speech, is good ● Can be customize freely ● Can never really die
  • 43. Freeware tools ● Getting rare nowadays ● Most free tools are also open source ● No license costs ● Tend to be easier to integrate with other tools than commercial ● Hard or impossible to customize ● Risk of discontinuation
  • 44. Generic skills to learn ● Scripting languages ● Python, Ruby, Perl, Javascript, ... ● Regular expressions ● A must when parsing textual outputs ● XPath and CSS selectors ● A must when doing web testing ● SQL ● A must with databases ● Using version control
  • 45. Is manual testing still needed? ● YES!! ● Avoid scripted manual testing ● Automate it instead ● Concentrate on exploratory testing ● Machines are great for running regression tests ● Humans are great for finding new defects
  • 46. Questions? Thanks! © Copyright Pekka Klärck <peke@eliga.fi> Creative Commons Attribution 3.0 License