0% found this document useful (0 votes)
92 views

Test Automation - Principles & Practices: Anand Bagmar Test Practice Lead

This document discusses principles and practices for test automation. It recommends automating unit, integration, functional, and non-functional tests. The test pyramid approach of automating unit tests extensively and using fewer automated UI/integration tests is described. Continuous integration practices like integrating and testing code daily are also covered. The document provides guidelines for designing test automation frameworks, including using proper abstraction layers, design patterns, programming best practices, and evolving the framework over time.

Uploaded by

zameer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

Test Automation - Principles & Practices: Anand Bagmar Test Practice Lead

This document discusses principles and practices for test automation. It recommends automating unit, integration, functional, and non-functional tests. The test pyramid approach of automating unit tests extensively and using fewer automated UI/integration tests is described. Continuous integration practices like integrating and testing code daily are also covered. The document provides guidelines for designing test automation frameworks, including using proper abstraction layers, design patterns, programming best practices, and evolving the framework over time.

Uploaded by

zameer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

TEST AUTOMATION –

PRINCIPLES & PRACTICES

Anand Bagmar

Test Practice Lead


ABOUT ME

@BagmarAnand

about.me/anand.bagmar

essenceoftesting.blogspot.com
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 Flight Passenger
Payment Confirmation
Search Results Details Info

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
A PRACTICE THAT MAKES TEAMS SUCCESSFUL?

Test Automation
A PRACTICE THAT MAKES TEAMS UNSUCCESSFUL?

Test Automation
Why do we do
Test Automation?
QUICK FEEDBACK
How to get quick
feedback from
Test Automation?
THE TEST PYRAMID

•  “Succeeding with Agile” – Mike Cohn


•  Martin Fowler – Test Pyramid
martinfowler.com/bliki/TestPyramid.html
TEST PYRAMID

Manual / Exploratory

UI
Business-
facing
Web Service Tests
Impact
View

Time Integration
Technology-
facing
Component Tests
Cost
Unit (xUnit / JavaScript)
TEST PYRAMID … INCLUDES NFRS

Manual / Exploratory
Accessibility
UI
P
S e Web Service
e r
c f
u o View
r r
i m Integration
t a
y n
c Component
e
Unit (xUnit / JavaScript)
REALITY
ICE-CREAM CONE ANTI PATTERN

Manual / Exploratory

UI

Web Service

View

JavaScript

Integration

Unit
DUAL TEST PYRAMID ANTI-PATTERN

Web Service
Manual / Exploratory
View

JavaScript
UI

Integration
Web Service

Unit

Developers Test Pyramid QA Team Test Pyramid


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

Browser / Device support

Scalable Reports & Metrics

Maintainable Support the types


of testing required

Easy to Use Operating System &


Database support

Language / tool Different


restrictions Environments

Tool support Run locally & remotely

Support features of Parallel Execution


Product-under-test
PRINCIPLES FOR TEST AUTOMATION FRAMEWORK

Headless executing

Abstraction Layers Extensible

Design Patterns Run via CI

Code Quality Logging

Test Data Take Screenshots

Tools & Utilities Video Recording

Evolve Refactor
HOW DO YOU DECIDE WHICH PRACTICE TO USE?

Understand the system(s) / product(s) you need to


test!!
Sample Test Automation
Framework Architecture
FRAMEWORK ABSTRACTION LAYERS
Summary - Test
Automation Framework
“Best” Practices
Assertions & Validations Identify intent in
In Business Layer business terminology

Build Tools & Utilities


Model
Test Data

Evolve
Pages as
Dummy objects

Programming
practices
Proper abstraction layers

Design Patterns
OOPs
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
THANK YOU

@BagmarAnand
about.me/anand.bagmar
essenceoftesting.blogspot.com

You might also like