20230417 - Efficient testing with test doubles
Most of developers have probably heard of the term “mock” – a kind of object that you use in your automated tests to represent some other object. However, this is probably where all knowledge about “mocks” ends for you – if you are like most other AL developers, you have never written a “mock”, you have never used one, and very likely you don’t know that “mock” is just one of five types of test doubles.
Test doubles are one of the most important and most powerful tools in any developer’s toolbox: they allow writing efficient, fast performing, focused tests that require less setup and put less stress on the system.
This webinar will present five different types of test doubles: dummies, spies, stubs, fakes, and mocks. You will see these doubles in action in real-life test code, and you will see how each of them helps you in its own right.
After this webinar, you’ll be able to identify situations in which to use each of these different test doubles and how to write them. In the end, this will make your tests better.
Presenter: Vjekoslav Babic
Moderator: Luc van Vugt
00:02:58 - Vjeko's introduction
00:04:03 - Agenda
00:05:29 - Let's consider this piece of code
00:08:31 - What are test doubles?
00:09:32 - Let's consider this piece of code (again)
00:10:18 - Handled pattern - grab-and-handle doubles
00:13:52 - Why do we use test doubles?
00:16:37 - Example - currency conversion process
00:20:17 - Problems with naive testing approach
00:24:13 - How to improve the tests?
00:27:11 - How to indentify dependencies?
00:29:20 - Decouple dependencies
00:31:04 - Provide an inversion of control mechanism
00:33:06 - Refactor the application code
00:34:20 - We are now ready for test doubles
00:34:43 - Types of test doubles
-- 00:35:05 - Dummy
-- 00:37:57 - Stub
-- 00:39:32 - Spy
00:40:22 - Back to currency conversion example
-- 00:51:42 - Fake
-- 00:54:37 - Mock
01:01:26 - Where AL makes it complicated
01:03:29 - Takeaways
01:05:27 - Q & A
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «20230417 - Efficient testing with test doubles», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.