Slide 1

Slide 1 text

100% Test Covɘrage Myth or Reality? Serge Matveenko twitter.com/lig1

Slide 2

Slide 2 text

Myths

Slide 3

Slide 3 text

Myths ● Full coverage doesn’t defend logic errors

Slide 4

Slide 4 text

Myths ● Full coverage doesn’t defend logic errors ● Full coverage is for Unit Tests

Slide 5

Slide 5 text

Myths ● Full coverage doesn’t defend logic errors ● Full coverage is for Unit Tests ● Full coverage is for TDD

Slide 6

Slide 6 text

Myths ● Full coverage doesn’t defend logic errors ● Full coverage is for Unit Tests ● Full coverage is for TDD ● Full coverage leads to very long test runs

Slide 7

Slide 7 text

Myths ● Full coverage doesn’t defend logic errors ● Full coverage is for Unit Tests ● Full coverage is for TDD ● Full coverage leads to very long test runs ● Full coverage is good but I have no time for that

Slide 8

Slide 8 text

First, count it properly

Slide 9

Slide 9 text

First, count it properly ● Linters, static checkers, code analysis — cover everything

Slide 10

Slide 10 text

First, count it properly ● Linters, static checkers, code analysis — cover everything ● Unit tests — cover everything

Slide 11

Slide 11 text

First, count it properly ● Linters, static checkers, code analysis — cover everything ● Unit tests — cover everything ● Integration tests ○ Delegate API/contract testing to Unit Tests, ensure API specs are implemented ○ Delegate interoperability testing to Functional Tests, ensure API do their job

Slide 12

Slide 12 text

First, count it properly ● Linters, static checkers, code analysis — cover everything ● Unit tests — cover everything ● Integration tests ○ Delegate API/contract testing to Unit Tests, ensure API specs are implemented ○ Delegate interoperability testing to Functional Tests, ensure API do their job ● Functional tests — cover everything again

Slide 13

Slide 13 text

Full coverage doesn’t defend logic errors

Slide 14

Slide 14 text

Full coverage doesn’t defend logic errors ● True

Slide 15

Slide 15 text

Full coverage doesn’t defend logic errors ● True for Unit Tests

Slide 16

Slide 16 text

Full coverage doesn’t defend logic errors ● True for Unit Tests ● False for Functional Tests

Slide 17

Slide 17 text

Full coverage is for Unit Tests

Slide 18

Slide 18 text

Full coverage is for Unit Tests ● True

Slide 19

Slide 19 text

Full coverage is for Unit Tests ● True if you like to carry orphaned code for years

Slide 20

Slide 20 text

Full coverage is for TDD

Slide 21

Slide 21 text

● True Full coverage is for TDD

Slide 22

Slide 22 text

● True ● But not exclusively Full coverage is for TDD

Slide 23

Slide 23 text

● True ● But not exclusively ● Full coverage doesn’t depend on strategie Full coverage is for TDD

Slide 24

Slide 24 text

● True ● But not exclusively ● Full coverage doesn’t depend on strategie ● Full coverage applies for any strategie independently Full coverage is for TDD

Slide 25

Slide 25 text

Full coverage leads to very long test runs

Slide 26

Slide 26 text

Full coverage leads to very long test runs ● True

Slide 27

Slide 27 text

Full coverage leads to very long test runs ● True when you have a lot to test

Slide 28

Slide 28 text

Full coverage leads to very long test runs ● True when you have a lot to test ● Automate Smoke Testing on development branches

Slide 29

Slide 29 text

Full coverage leads to very long test runs ● True when you have a lot to test ● Automate Smoke Testing on development branches ● “Namespaces are one honking great idea -- let's do more of those!”

Slide 30

Slide 30 text

Full coverage is good but I have no time for that

Slide 31

Slide 31 text

Full coverage is good but I have no time for that ● True

Slide 32

Slide 32 text

Full coverage is good but I have no time for that ● True if you like dig a hole for yourself

Slide 33

Slide 33 text

Full coverage is good but I have no time for that ● True if you like dig a hole for yourself ● Make yourself get used to it ● You will learn to do it faster ● You will like it ● You won’t see you life without it☺

Slide 34

Slide 34 text

To TDD or not to TDD?

Slide 35

Slide 35 text

To TDD or not to TDD? ● TDD is good

Slide 36

Slide 36 text

To TDD or not to TDD? ● TDD is good ● TDD is useless

Slide 37

Slide 37 text

To TDD or not to TDD? ● TDD is good ● TDD is useless ● It doesn’t matter

Slide 38

Slide 38 text

Full Coverage Reality ● Have full coverage on different test strategies ○ Static ○ Unit ○ Functional ● Know your tools ○ Smoke ○ Bisect ○ Mocks ○ Fixtures ○ Log Levels ● Full Coverage means 100% ○ 99% is the same is 1%

Slide 39

Slide 39 text

Thank you! Serge Matveenko github.com/lig twitter.com/lig1