Golang's Mocking Techniques - Kyle Yost | hatchpad Huddle

  Рет қаралды 37,002

hatchpad

hatchpad

3 жыл бұрын

Golang's Mocking Techniques - Kyle Yost | hatchpad Huddle
🚀 Sign-Up for Weekly hatchpad Newsletter: www.myhatchpad.com/newsletter/
🔔 Get alerted about startup job openings: www.myhatchpad.com/job/submit...
During this discussion, Kyle Yost, a Software Engineer at CB Insights, will walk through the following 5 Mocking Techniques:
Higher-Order Functions
Monkey Patching
Interface Substitution
Embedding Interfaces
Mocking out Downstream HTTP Calls with net/http/httptest
🐣 What is hatchpad? 🐣
Hatchpad is the community for startup technologists.
Our members include Software Engineers, Product Managers, Data Scientists, and Tech Executives; all connected through their passion for startups and desire to create innovative technology.
Every week we chat with startup technologists to provide you behind the scenes insights on technical skills, career advice, and industry trends.
If you want to learn from and grow alongside a curated group of startup technical professionals, this community is for you.

Пікірлер: 19
@waffleboot
@waffleboot 3 жыл бұрын
<a href="#" class="seekto" data-time="976">16:16</a> "I need to mock a function" Higher Order Functions <a href="#" class="seekto" data-time="1230">20:30</a> "I need to mock a function" Monkey Patching <a href="#" class="seekto" data-time="1375">22:55</a> "I need to mock a method on a type" <a href="#" class="seekto" data-time="1555">25:55</a> "Accept interfaces, return structs" <a href="#" class="seekto" data-time="1620">27:00</a> "I have a large inteface, I need to mock a small set of its methods" <a href="#" class="seekto" data-time="1755">29:15</a> Embedding can be a hole in the type system <a href="#" class="seekto" data-time="1785">29:45</a> "I need to mock an HTTP call"
@kevinkkirimii
@kevinkkirimii 5 ай бұрын
Well done Kyle. As old as this is, it is so relevant and very informative. I love the 'large interface - small set' test. You have opened my mind to a pattern I can use even beyond mock testing. Have an air coffee on me. Thanks dude and be blessed.
@vedrandekovic
@vedrandekovic 3 жыл бұрын
Probably the best explanation of the golang mocking on the web. Thank you!
@shub_zzz
@shub_zzz 3 жыл бұрын
Wish I saw this video a year earlier when I started learning Go. My first language for work env is Go. And even after a 6 months I was not sure about unit testing in Go. This is really helpful for beginners!!!
@SeanMacdonald_CodeMonk
@SeanMacdonald_CodeMonk 2 ай бұрын
excellent talk. Excellent comments. Excellent points. Excellent wisdom
@hereallyfast
@hereallyfast 5 ай бұрын
The monkey patching thing is fire 🔥
@domemvs
@domemvs 3 ай бұрын
Invaluable video. Thank you
@stack.1
@stack.1 2 ай бұрын
2024 still super super helpful
@ultiumlabs4899
@ultiumlabs4899 2 жыл бұрын
Kyle, it is really really helpful. Thank you.
@hatchpad1444
@hatchpad1444 2 жыл бұрын
Glad it was helpful for you!
@sumer9999
@sumer9999 2 жыл бұрын
A gem of a video
@hatchpad1444
@hatchpad1444 2 жыл бұрын
Thanks for watching!
@Christo6020
@Christo6020 7 ай бұрын
Great talk! Just to mention that nowadays gomock is archived, but Uber maintains a fork.
@imsachinraut
@imsachinraut 2 жыл бұрын
Thank you so much Kyle Host for this superb unit testing video. Is there any way for testing channels, signals, goroutines, locks.
@codertjay
@codertjay 5 ай бұрын
Just got what i really want to know
@hereallyfast
@hereallyfast 5 ай бұрын
EDIT: Looks like you get to this at the end of the talk 😂. If you have a large interface and you need to test just a few of the methods then you need to be writing more SOLID and idiomatic go. "Interface Segregation Principle revolves around the idea that clients should not be forced to rely on methods they do not use. To achieve this, the principle suggests creating specific interfaces or classes tailored to the needs of individual clients."
@johnmyeager
@johnmyeager 3 жыл бұрын
What IDE is he using when doing the demo? I usually just use Vim, but I'm considering my options. It's visible at kzfaq.info/get/bejne/gquei6Wmyqymqp8.html
@Slash3b
@Slash3b 3 жыл бұрын
goland
@hereallyfast
@hereallyfast 5 ай бұрын
How about not mocking
Generics in Go - Presented by Damien Stanton | hatchpad Huddle
46:32
How to mock in your Go tests - Golang Tutorial
43:43
Software Engineering Made Easy
Рет қаралды 12 М.
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 2,7 МЛН
Always be more smart #shorts
00:32
Jin and Hattie
Рет қаралды 37 МЛН
Тестирование в Go: от плохого к хорошему
1:19:51
Эйч Навыки — менторская программа
Рет қаралды 26 М.
Testing with golang and testify - tutorial part 1
13:45
Thomas Langhorst
Рет қаралды 12 М.
01. Russ Cox - Go Testing By Example | GopherConAU 2023
43:57
GopherConAU
Рет қаралды 12 М.
Unit testing in golang - a beginners + advanced-ish tutorial
13:12
Thomas Langhorst
Рет қаралды 7 М.
Google I/O 2012 - Go Concurrency Patterns
51:27
Google for Developers
Рет қаралды 798 М.
Go Testing By Example (GopherCon Australia 2023)
38:45
Russ Cox
Рет қаралды 12 М.
Генерация и использование моков в Go / Mockery
23:35
Николай Тузов — Golang
Рет қаралды 16 М.
[Golang] Testing with Ginkgo
10:14
Panpito
Рет қаралды 11 М.