Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal...

36
Holy "Test Pyramid" How it ruins your life

Transcript of Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal...

Page 1: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Holy "Test Pyramid"How it ruins your life

Page 2: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

About

Yaroslav Pernerovsky

@ysparrow

Page 3: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

About

https://qaguild-slack.herokuapp.com/

Page 4: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

About

http://automation-remarks.com/podcast/

Page 5: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Unit

Integration

E2E

Page 6: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Unit

Integration

E2E

Manual

Page 7: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

a

Page 8: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%
Page 9: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%
Page 10: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%
Page 11: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

• http://blog.codepipes.com/testing/software-testing-antipatterns.html

Page 12: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Unit

Integration

E2E

White-boxIndependent unitsMocks/stubs

White/Black-boxSome deploymentExternal systems

Black-boxFully deployed systemReal life scenarios

Page 13: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Integrationü uses databaseü uses network to call another component/application

ü external system (MQ, mail server etc.)ü reads/writes files or performs other I/Oü does not rely on source code, uses deployed binary instead

http://blog.codepipes.com/testing/software-testing-antipatterns.html

Page 14: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

What is wrong with the Pyramid?

Page 15: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

It is a theoreticalmetaphor

Page 16: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

It is almost unachievable in

real world

Page 17: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Unit

Integration

E2E

Created by Developers

Sometimes by DevelopersSometimes by Testers

Usually by Testers

Page 18: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%
Page 19: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Contexts differences

Communication issues

Industry stereotypes

Page 20: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Developers should create all the tests to build

the canonical test pyramid

Page 21: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%
Page 22: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Become a "developer"

Talk to each other

Brake stereotypes

Page 23: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

What is wrong with the tests in Pyramid?

Page 24: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

CC=3 CC=2 CC=4++

CC=3 CC=2 CC=4

=9

=24

Page 25: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Having the "wrong" kind of tests

Unit

Integration

Page 26: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Having the "wrong" kind of tests

Unit

Integration

Page 27: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Having the "wrong" kind of tests

Unit

Integration

GUI

Page 28: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Testing the wrong functionality

Core

Critical

Other

Page 29: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

20%

Page 30: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Code coverage

Page 31: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Codepipes Testing Metrics (CTM)Metric Name Description Ideal value Usual value Problematic

value

PDWT% of Developers writing tests

100% 20%-70% Anything less than 100%

PBCNT% of bugs that create new tests

100% 0%-5% Anything less than 100%

PTVB% of tests that verify behavior

100% 10% Anything less than 100%

PTD% of tests that are deterministic

100% 50%-80% Anything less than 100%

http://blog.codepipes.com/testing/software-testing-antipatterns.html

Page 32: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

0% 100%Code coverage

effo

rt n

eeded

Page 33: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

0% 100%Code coverage

Valu

e fr

om

tes

ts

Page 34: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Treating TDD as a religion

ü you can write tests before

ü you can write tests at the same time

ü you can write tests after

ü you can never write tests

http://blog.codepipes.com/testing/software-testing-antipatterns.html

Page 35: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%

Itogi podvedyom

ü Triangle is a mental abstractionü It should be treated as abstractionü Think before actü Don't blame yourselfü Use right metricsü Improve your programming skillsü Right tests over making trianglesü Do not hesitate to kill shitty tests

Page 36: Holy Test Pyramid - IT Weekend · CodepipesTesting Metrics (CTM ) Metric Name Description Ideal value Usual value Problematic value PDWT % of Developers writing tests 100% 20%-70%