Selenium DeTox for Achieving the Right Testing Pyramid

33
Manual Checking End- to End Selenium Tests 70% Integration Tests 20% Unit Tests 10% Unit Tests 70% Domain Logic Acceptance Tests 10% Integration Tests 9% Workflow API Tests 6% End to End Flow Tests 4% UI 1% Naresh Jain @nashjain Selenium Detox for Achieving the Right Test Pyramid

description

Our project was a classic example of Selenium gone wild! As our team embraced the test automation journey, we went crazy and implemented tons of Selenium tests, one for every permutation possible. Soon we realized our feedback cycles were delayed. Our builds were taking hours instead of minutes. And we had a set of complex, fragile tests, which resulted in a lot of false-negative scenarios and finger pointing. At this point, our team had realized that this is not the path forward. We decided to seriously look at our Selenium tests. We pretty much moved 80% of our Se tests to lower-layers (non-GUI based) tests. And now we have the right testing pyramid on our project. In this presentation, Naresh Jain explains IDeaS' journey (strategy, techniques, tools, mindset-change and approaches we took) through this transition.

Transcript of Selenium DeTox for Achieving the Right Testing Pyramid

Page 1: Selenium DeTox for Achieving the Right Testing Pyramid

Manual Checking

End- to End Selenium Tests 70%

Integration Tests20%

Unit Tests10% Unit Tests 70%

Domain Logic Acceptance Tests 10%

Integration Tests 9%

Workflow API Tests 6%

End to End Flow Tests

4%

UI 1%

Naresh Jain @nashjain

Selenium Detox for Achieving the Right Test Pyramid

Page 2: Selenium DeTox for Achieving the Right Testing Pyramid

Selenium Detox for Achieving the Right Test Pyramid

Naresh Jain@nashjain

Page 3: Selenium DeTox for Achieving the Right Testing Pyramid
Page 4: Selenium DeTox for Achieving the Right Testing Pyramid

Achieving the Right Test Pyramid

Aditya Saigaonkar

Kirtesh Wani

Page 5: Selenium DeTox for Achieving the Right Testing Pyramid

Background

IDeaS is capable of applying 25 years of experience,

expertise and client dedication toward an expanding suite of automated revenue management solutions.

Page 6: Selenium DeTox for Achieving the Right Testing Pyramid

Background

Page 7: Selenium DeTox for Achieving the Right Testing Pyramid

Background

Page 8: Selenium DeTox for Achieving the Right Testing Pyramid

Background - 2011

5%

95% No Automation

Automation Coverage

Page 9: Selenium DeTox for Achieving the Right Testing Pyramid

Background

1 Months2 Months

0 0.5 1 1.5 2 2.5 3 3.5

Months

Typical Release Cycle

Development Regression

Page 10: Selenium DeTox for Achieving the Right Testing Pyramid

Background

Page 11: Selenium DeTox for Achieving the Right Testing Pyramid

Critical Issues reported from Production

0

2

4

6

8

10

12

Critical Data Issues Cosmetic Localization

Issues

Page 12: Selenium DeTox for Achieving the Right Testing Pyramid

Background

Page 13: Selenium DeTox for Achieving the Right Testing Pyramid

After Automation Introduced - 2013

Selenium Tests 45%

Unit & Integration Tests 20%

No Automation 35%

Automation Coverage

Page 14: Selenium DeTox for Achieving the Right Testing Pyramid

After Automation Introduced

2.25 Months 3 Weeks

0 0.5 1 1.5 2 2.5 3 3.5

Months

Typical Release Cycle

Development Regression

Page 15: Selenium DeTox for Achieving the Right Testing Pyramid

Critical Issues reported from Production

0

2

4

6

8

10

12

Critical Data Issues Cosmetic Localization

Page 16: Selenium DeTox for Achieving the Right Testing Pyramid

Duration…

0 0.5 1 1.5 2 2.5

Years

Duration of Implementation

2 Years

Page 17: Selenium DeTox for Achieving the Right Testing Pyramid

Demo

• Selenium WebDriver Demo

Page 18: Selenium DeTox for Achieving the Right Testing Pyramid

State of the Product

Tightly coupled with UI

Browser Dependent Data tests

False fails

Difficult to pinpoint real culprit

Difficult to maintain and time consuming as test are fragile

Lagging with current release development

Image Courtesy: Alex Yakyma

Page 19: Selenium DeTox for Achieving the Right Testing Pyramid

Analysis of Bugs Report

10%

90% Data Failures

Bug Report Analysis

UI Navigation Failures

Page 20: Selenium DeTox for Achieving the Right Testing Pyramid

State of the Product

Manual Checking

End- to End Selenium Tests 70%

Integration Tests20%

Unit Tests10%

Page 21: Selenium DeTox for Achieving the Right Testing Pyramid

Manual Checking

End- to End Selenium Tests 70%

Integration Tests20%

Unit Tests10% Unit Tests 70%

Domain Logic Acceptance Tests 10%

Integration Tests 9%

Workflow API Tests 6%

End to End Flow Tests

4%

UI 1%

Typical test strategies lead to an inverted testing pyramid

This is the need of the hour….Courtesy: Naresh Jain @AgileFAQs.com

The Test Pyramid

Page 22: Selenium DeTox for Achieving the Right Testing Pyramid

Our transition story…

• We decided to "Test things right , at right place on right time" which would result in "right test pyramid“

Unit Tests 70%

Domain Logic Acceptance Tests 10%

Integration Tests 9%

Workflow API Tests 6%

End to End Flow Tests

4%

UI 1%

Page 23: Selenium DeTox for Achieving the Right Testing Pyramid

Our transition story…

Application UI

Service Layer

DAO Layer

Automated UI Tests

Tightly Coupled

Fragile

Lag with current development

Automate One Level Below UI

UI Independent

Robust & Stable

With current dev cycle

Fast Execution

Page 24: Selenium DeTox for Achieving the Right Testing Pyramid

Introduced BDD with Cucumber

Page 25: Selenium DeTox for Achieving the Right Testing Pyramid

Dev & QA Pairing

Developer QA

Page 26: Selenium DeTox for Achieving the Right Testing Pyramid

Quick Demo

Page 27: Selenium DeTox for Achieving the Right Testing Pyramid

Current Status

Selenium Tests 10%

Workflow Tests: 40%

No Automation 20%

Unit & Integration Tests 30%

Test Automation Status

Page 28: Selenium DeTox for Achieving the Right Testing Pyramid

After Right Testing Pyramid

1 Week2.75 Months

0 0.05 0.1 0.15 0.2 0.25 0.3

0 0.5 1 1.5 2 2.5 3 3.5

Months

Typical Release Cycle

Regression Time Development

Page 29: Selenium DeTox for Achieving the Right Testing Pyramid

Critical Issues reported from Production

0

2

4

6

8

10

12

Critical Data Issues Cosmetic Localization

Page 30: Selenium DeTox for Achieving the Right Testing Pyramid

Duration…

0 0.5 1 1.5 2 2.5 3 3.5

Months

Duration of Implementation

3 Months

Page 31: Selenium DeTox for Achieving the Right Testing Pyramid

Pain points

• Learning curve for the team

• Difficult to implement in case where no API is exposed or tight coupling with UI

• Heavy dependency on pre-populated database

Page 32: Selenium DeTox for Achieving the Right Testing Pyramid

Looking ahead

• Expose RESTful APIs for all upcoming features

• Move BDD specs to lower layers

• Moving away from baseline database

Courtesy: http://3.bp.blogspot.com/

Page 33: Selenium DeTox for Achieving the Right Testing Pyramid

© Copyright Integrated Decisions and Systems, Inc. (IDeaS – A SAS COMPANY)

Visit IDeaS online at www.ideas.com

Questions?

[email protected]

[email protected]

Naresh Jain @nashjain