Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Advanced Testing with Go

Gopher Academy via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
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

Reviews

Start your review of Advanced Testing with Go

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.