SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Test Automation
Test AutomationTest Automation
Test Automationrockoder
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework IntroductionPekka Klärck
 
Test automation framework
Test automation frameworkTest automation framework
Test automation frameworkQACampus
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testingKanoah
 
Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8a34sharm
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation TestingArchana Krushnan
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber Knoldus Inc.
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testingdidev
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentMike Douglas
 
Agile QA and Testing process
Agile QA and Testing processAgile QA and Testing process
Agile QA and Testing processGloria Stoilova
 
How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy Impetus Technologies
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comIdexcel Technologies
 
automation testing benefits
automation testing benefitsautomation testing benefits
automation testing benefitsnazeer pasha
 

Mais procurados (20)

Test Automation
Test AutomationTest Automation
Test Automation
 
Robot Framework Introduction
Robot Framework IntroductionRobot Framework Introduction
Robot Framework Introduction
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
 
Test automation framework
Test automation frameworkTest automation framework
Test automation framework
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8Role Of Qa And Testing In Agile 1225221397167302 8
Role Of Qa And Testing In Agile 1225221397167302 8
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
 
test_automation_POC
test_automation_POCtest_automation_POC
test_automation_POC
 
Test automation process
Test automation processTest automation process
Test automation process
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Agile QA and Testing process
Agile QA and Testing processAgile QA and Testing process
Agile QA and Testing process
 
How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy How to Design a Successful Test Automation Strategy
How to Design a Successful Test Automation Strategy
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.com
 
automation testing benefits
automation testing benefitsautomation testing benefits
automation testing benefits
 

Destaque

Introduction to Gauge
Introduction to GaugeIntroduction to Gauge
Introduction to Gaugevodqancr
 
Create the Future - Innovations in Testing
Create the Future - Innovations in TestingCreate the Future - Innovations in Testing
Create the Future - Innovations in TestingAnand Bagmar
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNetHai Tran Son
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction SheetvodQA
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
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 testingVikrant Chauhan
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation TestingArchana 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 OfJoe Colantonio
 
Arjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation WheelsArjuna - Reinventing the Test Automation Wheels
Arjuna - Reinventing the Test Automation WheelsRahul Verma
 
Specifications test automation pyramid public
Specifications test automation pyramid   publicSpecifications test automation pyramid   public
Specifications test automation pyramid publicSathyan Sethumadhavan
 
Test automation
Test automationTest automation
Test automationXavier Yin
 
Say NO To (More) Selenium Tests
Say NO To (More) Selenium TestsSay NO To (More) Selenium Tests
Say NO To (More) Selenium TestsAnand Bagmar
 
Need for automation testing
Need for automation testingNeed for automation testing
Need for automation testing99tests
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and PracticesAnand Bagmar
 

Destaque (19)

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
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
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
 
Test automation
Test automationTest automation
Test automation
 
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
 

Semelhante a Introduction to Test Automation

High Performance Software Engineering Teams
High Performance Software Engineering TeamsHigh Performance Software Engineering Teams
High Performance Software Engineering TeamsLars Thorup
 
Practical Software Testing Tools
Practical Software Testing ToolsPractical Software Testing Tools
Practical Software Testing ToolsDr Ganesh Iyer
 
Test automation - Building effective solutions
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutionsArtem Nagornyi
 
Open Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroSkills Matter
 
Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHPRogério Vicente
 
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 2019Moss 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 FrameworkPeter Kofler
 
Mobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / DemoMobile Automation Basic Concepts / Demo
Mobile Automation Basic Concepts / DemoTestingCR
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With GatlingKnoldus Inc.
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projectsIBACZ
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedAnna Royzman
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional ProgrammerDave 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 EngineeringMuhammad Shehata
 
Quality Assurance: An Overview
Quality Assurance: An OverviewQuality Assurance: An Overview
Quality Assurance: An OverviewAnant Corporation
 

Semelhante a 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
 

Último

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

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