decreasing false positives in automated testing

30

Click here to load reader

Upload: sauce-labs

Post on 15-Jul-2015

1.783 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Decreasing false positives in automated testing

Reducing False

Positives

&

Presents

Page 2: Decreasing false positives in automated testing

QASource Confidential

QASource & automation

100,000+ automated test cases

100+ Selenium engineers

500+ years collective automation experience

100+ automation frameworks

Page 3: Decreasing false positives in automated testing

QASource Confidential

Question #1

How many years of experience do you have with Selenium?

< 2 years 2-4 years 5+ years

What is the size of your automation suite?

< 100

test cases

100-250

test cases

250-500

test cases

500+

test cases

What is the most important reason why you invest in automation?

Save MoneySave Time/

Release Faster

More QA

Coverage

Question #2

Question #3

Attendees poll

Page 4: Decreasing false positives in automated testing

QASource Confidential

Anand Ramakrishnan

QA Director,

QASource

• 15+ years of automation experience

• Directing a team of 150 engineers

• M.S. in Computer Applications

• M.S. in Cyber Law & Security

Page 5: Decreasing false positives in automated testing

QASource Confidential

Key learnings & takeaways

What are false positives and why do they occur

Common causes and the challenges

How to implement key strategies to reduce them

Case studies and real world examples

FREE step by step guide to creating CSS locators

Page 6: Decreasing false positives in automated testing

QASource Confidential

What are false positives?

Tests that are marked as

failed, when in reality they

should have passed or should

functionally work.

Page 7: Decreasing false positives in automated testing

QASource Confidential

Why do false positives occur?

Automation

ApproachImplemented

FrameworkWritten Test

Page 8: Decreasing false positives in automated testing

QASource Confidential

Relying on UI

Relying on sequence of execution

Manual intervention

Slow performance

Reference data change

Shared environment

Change in UI element properties

Potential causes for false positives

Page 9: Decreasing false positives in automated testing

QASource Confidential

Impacts on automation

Ignoring failures

Wasting time investigating

failuresDecrease in productivity

Frustration for engineering team

Risk of missing potential bug

Increasing cost of automation

Uncertainty of application health

Page 10: Decreasing false positives in automated testing

QASource Confidential

Attendees poll

What is the rate of false positives

in your automation?

5% or less 5% to 15% 15% to 20% 20% or more

Page 11: Decreasing false positives in automated testing

QASource Confidential

Complex workflow application

Rich interactive UI

2500+ automated test cases

Page object pattern approach

Multiple OS, browsers and environments

Case study

Page 12: Decreasing false positives in automated testing

QASource Confidential

Frequent UI Changes

Synchronization issues

Memory leak issue

Challenges

Elements identified using

Xpath

Hardcoded waits

No tear down

ROOT CAUSE

CH

ALLEN

GES

Page 13: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Deploy application on optimal

configurations

Page 14: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Controlled environment for automation

Page 15: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Keeping tests short

Page 16: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Keeping tests independent

TEST SCRIPT 1

TEST SCRIPT 2

TEST SCRIPT 3

TEST SCRIPT 4

Create User

Create Group

Add User to Group

Search User

Page 17: Decreasing false positives in automated testing

QASource Confidential

Using right locators for objects identification

Keys to reducing false positives

IDs

Name

CSS locators

Page 18: Decreasing false positives in automated testing

QASource Confidential

Bad Practice

Object identification strategy

Good Practice

Page 19: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Tear-down approach

Page 20: Decreasing false positives in automated testing

QASource Confidential

Bad Practice

Tear down approach

Page 21: Decreasing false positives in automated testing

QASource Confidential

Good Practice

Tear down approach

Page 22: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Dynamic object synchronization

Page 23: Decreasing false positives in automated testing

QASource Confidential

Bad Practice

Object synchronization

Page 24: Decreasing false positives in automated testing

QASource Confidential

Good Practice

Object synchronization

Page 25: Decreasing false positives in automated testing

QASource Confidential

Keys to reducing false positives

Re-execution capability

RE-EXECUTION

LOGIC FLAG

TEST SUITE

TEST CASE 1

TEST CASE 2

—————

—————

—————

TEST CASE N

Pass

Failed

RE-EXECUTION OF

FAILED TESTS

Test case

name

Status Re-

executed

TEST CASE 1PASS NO

TEST CASE 2 PASSYES

TEST CASE 3 FAIL YES

_____ _____ _____

TEST CASE N PASS YES

EXECUTION

EXECUTION REPORT

Page 26: Decreasing false positives in automated testing

QASource Confidential

Conclusion

Using right locators for objects identification

Dynamic object synchronization

Re-execution capability

Tear-down approach

Keeping tests short Keeping tests independent

Controlled environment for automation

Deploy application on optimal configuration

Page 27: Decreasing false positives in automated testing

QASource Confidential

Benefits of eliminating false positives

Certainty of application health

Increase in productivity

Save time not investigating false

positives

Will not miss potential bugs

Decrease cost of automation

Page 28: Decreasing false positives in automated testing

QASource Confidential

Get your FREE Step by Step

Guide to Create CSS

Locators

qasource.com/[email protected]

Page 29: Decreasing false positives in automated testing

QASource Confidential

Q&A

Page 30: Decreasing false positives in automated testing

QASource Confidential