Save 37% off PRO during our Black Friday Sale! »

100% Test Covɘrage

100% Test Covɘrage

200442040b9d038626d92d408f499642?s=128

Serge Matveenko

May 14, 2017
Tweet

Transcript

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

  2. Myths

  3. Myths • Full coverage doesn’t defend logic errors

  4. Myths • Full coverage doesn’t defend logic errors • Full

    coverage is for Unit Tests
  5. Myths • Full coverage doesn’t defend logic errors • Full

    coverage is for Unit Tests • Full coverage is for TDD
  6. 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
  7. 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
  8. First, count it properly

  9. First, count it properly • Linters, static checkers, code analysis

    — cover everything
  10. First, count it properly • Linters, static checkers, code analysis

    — cover everything • Unit tests — cover everything
  11. 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
  12. 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
  13. Full coverage doesn’t defend logic errors

  14. Full coverage doesn’t defend logic errors • True

  15. Full coverage doesn’t defend logic errors • True for Unit

    Tests
  16. Full coverage doesn’t defend logic errors • True for Unit

    Tests • False for Functional Tests
  17. Full coverage is for Unit Tests

  18. Full coverage is for Unit Tests • True

  19. Full coverage is for Unit Tests • True if you

    like to carry orphaned code for years
  20. Full coverage is for TDD

  21. • True Full coverage is for TDD

  22. • True • But not exclusively Full coverage is for

    TDD
  23. • True • But not exclusively • Full coverage doesn’t

    depend on strategie Full coverage is for TDD
  24. • True • But not exclusively • Full coverage doesn’t

    depend on strategie • Full coverage applies for any strategie independently Full coverage is for TDD
  25. Full coverage leads to very long test runs

  26. Full coverage leads to very long test runs • True

  27. Full coverage leads to very long test runs • True

    when you have a lot to test
  28. Full coverage leads to very long test runs • True

    when you have a lot to test • Automate Smoke Testing on development branches
  29. 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!”
  30. Full coverage is good but I have no time for

    that
  31. Full coverage is good but I have no time for

    that • True
  32. Full coverage is good but I have no time for

    that • True if you like dig a hole for yourself
  33. 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☺
  34. To TDD or not to TDD?

  35. To TDD or not to TDD? • TDD is good

  36. To TDD or not to TDD? • TDD is good

    • TDD is useless
  37. To TDD or not to TDD? • TDD is good

    • TDD is useless • It doesn’t matter
  38. 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%
  39. Thank you! Serge Matveenko github.com/lig twitter.com/lig1