inverting test pyramid - a first hand experience report

42

Upload: naresh-jain

Post on 04-Jul-2015

369 views

Category:

Software


0 download

DESCRIPTION

Test automation is extremely crucial in adoption of an agile delivery. However, it can take one for a ride, if the approach is not correct. In this sensational, heart throbbing, experience report, we'll share our story of how we turned around an inefficient, expensive automation style to lean, efficient style. In addition to sharing a real-world example, we'll also share some of the key challenges we faced and how we solved them. If you are convinced about the Testing Pyramid, but are struggling to invert it, then this session is for you. Business Impact: * Earlier Defect Detection - Higher test coverage at Unit/Intermediate layers lead to earlier defect detection. Reduced number of issues found on higher test environments/Production. Reduced cost of defect fixing. * Reduced maintenance cost - UI tests are fragile and costlier to maintain Vs backend tests. No of changes in services layer are comparatively less. Reduced test execution time - Backend tests are much faster. Almost 7-10 times faster than UI Tests - improved build certification time. * Test feedbacks are naturally distributed across layers of application. Test feedbacks are more pin pointed/ granular. Details: http://confengine.com/agile-pune-2014/proposal/471/inverting-test-pyramid-a-first-hand-experience-report Conference: http://pune.agileindia.org/

TRANSCRIPT

Page 1: Inverting Test Pyramid - A First Hand Experience Report
Page 2: Inverting Test Pyramid - A First Hand Experience Report

Inverting Test PyramidExperience Report

Sachin Natu @natusachinNaresh Jain @nashjain

Page 3: Inverting Test Pyramid - A First Hand Experience Report

25YEARS 6000+CLIENT

S

Nr 1M ROOMS 94COUNTRIES 95%

+ago we started

helping clients

manage their

revenue

later we’re still finding

the revenue opportunity

in every situation

around the world are

priced every single day

using IDeaS

on 6 continents have

hotels that now run on

IDeaS Revenue

Management

Systems

More than 95

percent of all

our clients are

still working

with us today.

About IDeaS

Page 4: Inverting Test Pyramid - A First Hand Experience Report

Our Worldwide Clients :

Hospitality + Travel + Distribution

Page 5: Inverting Test Pyramid - A First Hand Experience Report

Agenda

● Where were

we?

● Problem

● How we tried to

solve?

● How we

optimized?

Page 6: Inverting Test Pyramid - A First Hand Experience Report

Status of regression time

Page

Page 7: Inverting Test Pyramid - A First Hand Experience Report

No Automation !

Page 8: Inverting Test Pyramid - A First Hand Experience Report

Problems

● Thousands of

regression tests

● Cross cutting defects

found were more.

● Repeat Execution

Page 9: Inverting Test Pyramid - A First Hand Experience Report

Moving to shorter release cycle - a dream?

Page 10: Inverting Test Pyramid - A First Hand Experience Report

Regression period is incompressible

Page 11: Inverting Test Pyramid - A First Hand Experience Report

Manual and repetitive tasks are error prone.

Page 12: Inverting Test Pyramid - A First Hand Experience Report

Issue leakages

Page

Releases

Page 13: Inverting Test Pyramid - A First Hand Experience Report

Let’s automate regression

Page

Page 14: Inverting Test Pyramid - A First Hand Experience Report

UI Test

Page

Page 15: Inverting Test Pyramid - A First Hand Experience Report

After Automation Introduced

Page 16: Inverting Test Pyramid - A First Hand Experience Report

Production feedback

Page

Page 17: Inverting Test Pyramid - A First Hand Experience Report

Duration…

2

Yrs

Team of 2 full time Automation Testers

Page 18: Inverting Test Pyramid - A First Hand Experience Report

State of the Product

Manual

Checking 45%

End- to End UI Tests 40%

Integration Tests10%

Unit Tests5%

Page 19: Inverting Test Pyramid - A First Hand Experience Report

Always Catching Up

Page 20: Inverting Test Pyramid - A First Hand Experience Report

No pinpointed feedback

Page 21: Inverting Test Pyramid - A First Hand Experience Report

Silos

Page 22: Inverting Test Pyramid - A First Hand Experience Report

Tests are slow

Page 23: Inverting Test Pyramid - A First Hand Experience Report

Costly to maintain

Page 24: Inverting Test Pyramid - A First Hand Experience Report

Is there way out?

Page

Page 25: Inverting Test Pyramid - A First Hand Experience Report

Analysis of Bugs Report

Page 26: Inverting Test Pyramid - A First Hand Experience Report

Why are we testing from far?

Page 27: Inverting Test Pyramid - A First Hand Experience Report

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 28: Inverting Test Pyramid - A First Hand Experience Report

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%

E to E

4%

UI

1%

Page 29: Inverting Test Pyramid - A First Hand Experience Report

Business logic test

Page 30: Inverting Test Pyramid - A First Hand Experience Report
Page 31: Inverting Test Pyramid - A First Hand Experience Report

Current Status

Page 32: Inverting Test Pyramid - A First Hand Experience Report

Benefits

Page 33: Inverting Test Pyramid - A First Hand Experience Report

Automation is part of development

• TDD

• BDD

• UI Tests only worry for UI

Page 34: Inverting Test Pyramid - A First Hand Experience Report

Improved collaboration

Developer QA

Page 35: Inverting Test Pyramid - A First Hand Experience Report

UI Tests – Grouping Functionality

80 Scenarios - 300 + Min!

Page 36: Inverting Test Pyramid - A First Hand Experience Report

Correct automation improved time.

80 Scenarios < Min!

Workflow - 4 Min

UI Tests - 4 Min

Page 37: Inverting Test Pyramid - A First Hand Experience Report

Regression timelines

Page

Months

Page 38: Inverting Test Pyramid - A First Hand Experience Report

Feels like Agile now...

Page

Page 39: Inverting Test Pyramid - A First Hand Experience Report

Challenges

• Legacy code - “Unit test unfriendly”

• Mapping acceptance tests with various slices of pyramid

• Building team competencies

• Pairing/ collaboration is backbone

Page 40: Inverting Test Pyramid - A First Hand Experience Report

Key learning

• Use UI automation only where really necessary

• It’s team responsibility

• Testability is important criteria.

Unit Tests 70%

Domain Logic Acceptance

Tests 10%

Integration Tests 9%

Workflow API

Tests 6%

End to

End Flow

Tests 4%

UI

1

%

Page 41: Inverting Test Pyramid - A First Hand Experience Report

Naresh Jain @nashjainSachin Natu @natusachin

Page

Page 42: Inverting Test Pyramid - A First Hand Experience Report

Some Statistics...