Advanced Testing with Go
Offered By: Gopher Academy via YouTube
Course Description
Overview
Explore advanced testing techniques for Go in this conference talk from GopherCon 2017. Learn how HashiCorp tests their distributed systems, multi-process RPC, and highly security-sensitive Go code used by millions of users. Discover various testing methodologies including subtests, table-driven tests, test fixtures, golden files, and handling global state. Dive into strategies for testing networking, configurability, complex structs, and subprocessing. Gain insights on using interfaces, treating testing as a public API, and developing custom frameworks. Master the art of writing testable code and repeating yourself effectively in test scenarios. Understand how to leverage internal packages and test helpers to improve your Go testing practices.
Syllabus
Intro
TEST METHODOLOGY
TESTABLE CODE
SUBTESTS
TABLE DRIVEN TESTS
TEST FIXTURES
GOLDEN FILES
GLOBAL STATE
TEST HELPERS
REPEAT YOURSELF
INTERNAL PACKAGES
NETWORKING Testing networking? Make a real network connection
NETWORKING + That was a one-connection example. Easy to make an N-connection.
CONFIGURABILITY + Unconfigurable behavior is often a point of difficulty for tests.
COMPLEX STRUCTS
SUBPROCESSING Subprocessing is typical a point of difficult-to-test behavior. + Two options: 1. Actually do the subprocess
SUBPROCESSING: REAL
SUBPROCESSING: MOCK
INTERFACES
TESTING AS A PUBLIC API
CUSTOM FRAMEWORKS
Taught by
Gopher Academy
Related Courses
A Holistic Go ExperienceGopher Academy via YouTube Safe, Fast, and Easy - Building a Plugin System with WebAssembly
Gopher Academy via YouTube A Journey Through Integration Testing with Go - What Could Go Wrong?
Gopher Academy via YouTube Kraken Wrangling for Dummies - Go Module Dependency Management at Scale
Gopher Academy via YouTube Go, the Data Engineer's Missing Tool?
Gopher Academy via YouTube