igor khrol - how to make tests fast and to increase the efficiency of development

46
Как сделать тесты быстрыми и повысить эффективность разработки? Игорь Хрол, Toptal

Upload: agilelab

Post on 12-Apr-2017

88 views

Category:

Presentations & Public Speaking


0 download

TRANSCRIPT

Page 1: Igor Khrol - How to make tests fast and to increase the efficiency of development

Как сделать тесты быстрыми и повысить

эффективность разработки?

Игорь Хрол, Toptal

Page 2: Igor Khrol - How to make tests fast and to increase the efficiency of development

Обо мне• Игорь Хрол

• Инженер по тестированию в Toptal (www.toptal.com)

• ~10 лет в тестировании

• Инженер, менеджер, архитектор, консультант, тренер

• www.khroliz.com

Page 3: Igor Khrol - How to make tests fast and to increase the efficiency of development

– Герман Греф, президент и председатель правления Сбербанка России

“В прошлом году мы сделали 40 тыс. изменений нашей системы. Если посмотреть на другие банки, мы в шоколаде. Но, если смотреть на Amazon, Google, мы ужасно

отстаем. Amazon делает 10 тыс. изменений своей системы в день.”

Page 4: Igor Khrol - How to make tests fast and to increase the efficiency of development

– Герман Греф, президент и председатель правления Сбербанка России

“В прошлом году мы сделали 40 тыс. изменений нашей системы. Если посмотреть на другие банки, мы в шоколаде. Но, если смотреть на Amazon, Google, мы ужасно

отстаем. Amazon делает 10 тыс. изменений своей системы в день.”

“Если мы сейчас меняем какую-то часть своей платформы, нам нужно два-три месяца

тестировать. Непонятно, где и что вылезет при этом. Это катастрофа.”

Page 5: Igor Khrol - How to make tests fast and to increase the efficiency of development

Регрессионная спираль смерти(с) Максим Дорофеев

Page 6: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что делать?

Page 7: Igor Khrol - How to make tests fast and to increase the efficiency of development

Автоматизация!

Page 8: Igor Khrol - How to make tests fast and to increase the efficiency of development

Давайте считать

Page 9: Igor Khrol - How to make tests fast and to increase the efficiency of development

Давайте считать

• “2-3 месяца тестировать”

Page 10: Igor Khrol - How to make tests fast and to increase the efficiency of development

Давайте считать

• “2-3 месяца тестировать”

• Допустим, 3 тестировщика

Page 11: Igor Khrol - How to make tests fast and to increase the efficiency of development

Давайте считать

• “2-3 месяца тестировать”

• Допустим, 3 тестировщика

• 3 человека * 160 часов * 2,5 месяца = 1200 часов

Page 12: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что у роботов?

Page 13: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что у роботов?• 1200 часов ручного труда

Page 14: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что у роботов?• 1200 часов ручного труда

• Допустим, тесты в 10 раз быстрее

Page 15: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что у роботов?• 1200 часов ручного труда

• Допустим, тесты в 10 раз быстрее

• 120 часов…

Page 16: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что у роботов?• 1200 часов ручного труда

• Допустим, тесты в 10 раз быстрее

• 120 часов…

• Возьмём 10 серверов

Page 17: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что у роботов?• 1200 часов ручного труда

• Допустим, тесты в 10 раз быстрее

• 120 часов…

• Возьмём 10 серверов

• 12 часов!

Page 18: Igor Khrol - How to make tests fast and to increase the efficiency of development

2-3 месяца vs 12 часов

Page 19: Igor Khrol - How to make tests fast and to increase the efficiency of development

2-3 месяца vs 12 часов

Хороший результат?

Page 20: Igor Khrol - How to make tests fast and to increase the efficiency of development

Типы проектов по длине цикла

Page 21: Igor Khrol - How to make tests fast and to increase the efficiency of development

Типы проектов по длине цикла

• Недели-месяцы

Page 22: Igor Khrol - How to make tests fast and to increase the efficiency of development

Типы проектов по длине цикла

• Недели-месяцы

• Дни-недели

Page 23: Igor Khrol - How to make tests fast and to increase the efficiency of development

Типы проектов по длине цикла

• Недели-месяцы

• Дни-недели

• Часы-дни

Page 24: Igor Khrol - How to make tests fast and to increase the efficiency of development

12 часов

Тесты не используются разработчиками

Page 25: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что делать? Какие должны быть автотесты?

• Время выполнения - максимум 10 минут

• Запуск локально на машине разработчика

Page 26: Igor Khrol - How to make tests fast and to increase the efficiency of development

Что это за тесты-то такие?

?!

Page 27: Igor Khrol - How to make tests fast and to increase the efficiency of development

Модульные тесты Unit-тесты

Page 28: Igor Khrol - How to make tests fast and to increase the efficiency of development

Модульные тесты Unit-тесты

• Время выполнения одного - доли секунд

Page 29: Igor Khrol - How to make tests fast and to increase the efficiency of development

Модульные тесты Unit-тесты

• Время выполнения одного - доли секунд

• Короткие: быстро писать

Page 30: Igor Khrol - How to make tests fast and to increase the efficiency of development

Модульные тесты Unit-тесты

• Время выполнения одного - доли секунд

• Короткие: быстро писать

• Редко падают без причины

Page 31: Igor Khrol - How to make tests fast and to increase the efficiency of development

Модульные тесты Unit-тесты

• Время выполнения одного - доли секунд

• Короткие: быстро писать

• Редко падают без причины

• В случае падения - быстрый анализ результата

Page 32: Igor Khrol - How to make tests fast and to increase the efficiency of development

Недостатки

Page 33: Igor Khrol - How to make tests fast and to increase the efficiency of development

Недостатки

• Не повторяет действий пользователя на 100%

Page 34: Igor Khrol - How to make tests fast and to increase the efficiency of development

Недостатки

• Не повторяет действий пользователя на 100%

• Требуется знание технологий

Page 35: Igor Khrol - How to make tests fast and to increase the efficiency of development

Недостатки

• Не повторяет действий пользователя на 100%

• Требуется знание технологий

• Зачастую невозможно использовать с уже написанным кодом

Page 36: Igor Khrol - How to make tests fast and to increase the efficiency of development

Пирамида автоматизации тестирования

UI

API

Unit

http://martinfowler.com/bliki/TestPyramid.html

Page 37: Igor Khrol - How to make tests fast and to increase the efficiency of development

Почему мало/не используется?

Page 38: Igor Khrol - How to make tests fast and to increase the efficiency of development

Разработчики становятся ответственными за

тестирование

Page 39: Igor Khrol - How to make tests fast and to increase the efficiency of development

Разработчики становятся ответственными за

тестирование

Нужно менять культуру разработки

Page 40: Igor Khrol - How to make tests fast and to increase the efficiency of development

Тестировщики не обладают нужными

навыками

Page 41: Igor Khrol - How to make tests fast and to increase the efficiency of development

Тестировщики не обладают нужными

навыками

Нужны другие тестировщики

Page 42: Igor Khrol - How to make tests fast and to increase the efficiency of development

Как это выглядит?

Page 43: Igor Khrol - How to make tests fast and to increase the efficiency of development

Как это выглядит?• Unit-тесты

• Ruby - 5 минут

• Scala - 70 секунд

• JavaScript - 30 секунд

Page 44: Igor Khrol - How to make tests fast and to increase the efficiency of development

Как это выглядит?• Unit-тесты

• Ruby - 5 минут

• Scala - 70 секунд

• JavaScript - 30 секунд

• Интеграционные тесты - 10-15 минут

Page 45: Igor Khrol - How to make tests fast and to increase the efficiency of development

Как это выглядит?• Unit-тесты

• Ruby - 5 минут

• Scala - 70 секунд

• JavaScript - 30 секунд

• Интеграционные тесты - 10-15 минут

• Результат всех тестов - через 30 минут