Using fake objects in automated tests

  Рет қаралды 2,316

Mateus Guimarães

Mateus Guimarães

Күн бұрын

Пікірлер: 19
@kauffinger
@kauffinger Жыл бұрын
Right now I am deep in mocking hell, where everything was mocked - whenever I change any code of the services, at least 1 test breaks, even if no behaviour was changed. This makes so much more sense than my way - i just make the mock partial, ignore missing calls and mock the return values of anything that is needed. Still makes the code ugly and needs fiddling until it works. Thanks for the video!
Жыл бұрын
Thanks for watching and I’m glad I could be of help!
@stevebauman
@stevebauman Жыл бұрын
While I definitely like fakes and I think they are a great way to test, I will personally never default to them, and I think there has to be justification for them. They all come with additional baggage that mocking simply doesn't have: 1. Additional time to setup, and you have to now have to worry about designing your fakes assertion API 2. Lots of additional boilerplate for anything you would initially want to mock 3. Fakes now need their own tests, as they now encompass additional logic to make assertions, which could break, and may have their own bugs 4. Test code is now intertwined with application code
Жыл бұрын
Steve! Thanks for chiming in dude. I think the setup time is very minimal in regards to the benefits - setting up an interface and a different implementation is something you’re only going to do once. IME the annoyances I had with mocks throughout my life totally justify spending time with fakes. Obviously that’s very different with e.g library code where mocking happens frequently. You can easily remove coupling with the testing framework by having assertions within the test (if that’s what you meant, otherwise if it’s the in memory implementation being a test implemented intertwined with app code, I disagree). I just can’t see the benefits of mocks these days if fakes are an option.
@stevebauman
@stevebauman Жыл бұрын
@ Fair enough! Great video by the way and thanks for the reply! 🙏
@erfansabouri7362
@erfansabouri7362 Жыл бұрын
Thanks. You lighten me up.
Жыл бұрын
Glad I could be of help :-)
@oleksiiberestniev5432
@oleksiiberestniev5432 Жыл бұрын
many thanks
Жыл бұрын
Welcome!!
@chhirag
@chhirag Жыл бұрын
Thanks for the video, very well explained.
Жыл бұрын
Glad it was helpful!
@metaphoricallyspeaking
@metaphoricallyspeaking Жыл бұрын
Awesome video Mateus 👏
Жыл бұрын
Thanks buddy!
@user-bk1ts4th2h
@user-bk1ts4th2h Жыл бұрын
nice videos ! , thank you , please can you make videos inside playlists
Жыл бұрын
Thanks for the idea!
@Alguem387
@Alguem387 Жыл бұрын
wait i though fake objects and mocking where the same thing
Жыл бұрын
They’re both test doubles and serve the same purpose 👍
Жыл бұрын
Nice english!
Жыл бұрын
Valeu
Thinking about Aggregates in Active Record
19:22
Mateus Guimarães
Рет қаралды 2,9 М.
PHP-FPM vs Swoole execution model
15:36
Mateus Guimarães
Рет қаралды 7 М.
Can You Find Hulk's True Love? Real vs Fake Girlfriend Challenge | Roblox 3D
00:24
Yay😃 Let's make a Cute Handbag for me 👜 #diycrafts #shorts
00:33
LearnToon - Learn & Play
Рет қаралды 117 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,6 МЛН
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 79 М.
Laravel Core 101
15:58
Mateus Guimarães
Рет қаралды 2,7 М.
What is OpenTelemetry?
12:55
Highlight
Рет қаралды 13 М.
What I do before coding complex features
20:35
Mateus Guimarães
Рет қаралды 2,3 М.
The dangers of events and observers in Laravel applications
29:06
Mateus Guimarães
Рет қаралды 1,8 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 647 М.
How to properly integrate with 3rd party providers
16:27
Mateus Guimarães
Рет қаралды 2,2 М.
I Asked GPT-4 To Refactor My Legacy Codebase
12:39
Nick Chapsas
Рет қаралды 350 М.
DDD is not about code
14:12
Mateus Guimarães
Рет қаралды 1,4 М.
The most powerful way to use Eloquent
11:51
Mateus Guimarães
Рет қаралды 5 М.
Making iPhone16 pink📱
0:34
Juno Craft 주노 크래프트
Рет қаралды 27 МЛН
Говорят, ЛУЧШИЙ КОМПАКТ! Хвалёный VIVO X200 PRO Mini - не без ПРОБЛЕМ
25:40
Handy remote!
0:25
LeraKek
Рет қаралды 7 МЛН