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

Пікірлер: 2

  • @klauskaan6320
    @klauskaan6320 Жыл бұрын

    This might be the single most important webinar this year.

  • @Areopawebinars
    @Areopawebinars Жыл бұрын

    github.com/vjekob/al-test-doubles

Келесі