test automation - principles and practices
TRANSCRIPT
TEST AUTOMATION – PRINCIPLES & PRACTICES
Anand Bagmar
Test Practice Lead
@BagmarAnand
about.me/anand.bagmar
essenceoftesting.blogspot.com
ABOUT ME
What is Testing?
4
5
What does this mean?
LEARNING
¨ Test each part thoroughly
¨ Unit
¨ Test ways of working together
¨ Component Integration
¨ Test how it all comes together
¨ Functional
This is how the parts becomes a Pen!
7
But …. what about the things you do not see?
LEARNING CONTINUES …
¨ Test the Non Functionals
¨ NFRs
¨ Test the 3rd-party integration / interactions
¨ Integration
9
How does this apply to Software?
11
Flight Search
Search Results
Flight Details
Passenger Info Payment Confirmation
Application Server
DB
LEARNING CONTINUES …
¨ Test each part thoroughly
¨ Test ways of working together
¨ Test how it all comes together
¨ Test the Non Functionals
¨ Test the 3rd-party integration / interactions
¨ Understand Architecture – system & components
¨ Build Quality-in by Testing early
13
Practices
Test Automation
A PRACTICE THAT MAKES TEAMS SUCCESSFUL?
Test Automation
A PRACTICE THAT MAKES TEAMS UNSUCCESSFUL?
Why do we do Test Automation?
QUICK FEEDBACK
How to get quick feedback from
Test Automation?
• “Succeeding with Agile” – Mike Cohn
• Martin Fowler – Test Pyramid
martinfowler.com/bliki/TestPyramid.html
THE TEST PYRAMID
TEST PYRAMID
Unit (xUnit / JavaScript)
Manual / Exploratory
Component
Integration
View
Web Service
UI
Cost
Impact
Time
Business- facing Tests
Technology- facing Tests
TEST PYRAMID … INCLUDES NFRS
Unit (xUnit / JavaScript)
Component
Integration
View
Web Service
UI
Performance
Security
Accessibility
Manual / Exploratory
REALITY
ICE-CREAM CONE ANTI PATTERN
Manual / Exploratory
UI
Web Service
View
JavaScript
Integration
Unit
Web Service
View
JavaScript
Integration
Unit
Developers Test Pyramid QA Team Test Pyramid
DUAL TEST PYRAMID ANTI-PATTERN
Manual / Exploratory
UI
Web Service
CUP-CAKE ANTI-PATTERN
Is that enough?
Continuous Integration (CI)
CONTINUOUS INTEGRATION (CI)
”… is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible…."
- Martin Fowler, ThoughtWorks Chief Scientist
Ø http://www.thoughtworks.com/continuous-integration
CI PROCESS
TEST AUTOMATION FRAMEWORK DESIGN CRITERIA
Maintainable
Scalable
Browser / Device support
Support features of Product-under-test
Easy to Use
Different Environments
Parallel Execution
Tool support
Reports & Metrics
Support the types of testing required
Operating System & Database support
Run locally & remotely
Language / tool restrictions
PRINCIPLES FOR TEST AUTOMATION FRAMEWORK
Design Patterns
Abstraction Layers
Headless executing
Evolve
Code Quality
Take Screenshots
Refactor
Tools & Utilities
Extensible
Run via CI
Logging
Video Recording
Test Data
Understandthesystem(s)/product(s)youneedtotest!!
HOW DO YOU DECIDE WHICH PRACTICE TO USE?
Sample Test Automation Framework Architecture
FRAMEWORK ABSTRACTION LAYERS
Summary - Test Automation Framework
“Best” Practices
Assertions & Validations In Business Layer
Model Test Data
Proper abstraction layers
Pages as Dummy objects
Evolve
Programming practices
OOPs Design Patterns
Identify intent in business terminology
Build Tools & Utilities
REFERENCES
Page Objects – Google
https://code.google.com/p/selenium/wiki/PageObjects
Page Objects – Martin Fowler
http://martinfowler.com/bliki/PageObject.html
Perils of Page-Object Pattern – Anand Bagmar
http://essenceoftesting.blogspot.in/2014/09/perils-of-page-object-pattern.html
Test Design Consideration
http://docs.seleniumhq.org/docs/06_test_design_considerations.jsp
Evolve as you Learn
@BagmarAnand
about.me/anand.bagmar
essenceoftesting.blogspot.com
THANK YOU