Testing Go at Stream
Blog post from Stream
Stream's API is utilized by over 500 companies and 200 million users, and the company emphasizes a robust testing infrastructure to maintain code reliability while moving quickly. The primary services are developed in Go, and the blog post details the lessons learned from testing a large Go codebase. It highlights the importance of a solid testing workflow, involving test-driven development, peer reviews, and continuous integration tools such as Travis CI and Codecov. The team uses Go's testing package along with additional tools like testify for cleaner and more manageable tests, and they employ both dependency injection and the GoMock framework for mocking in unit tests. Integration and acceptance tests are handled separately in a dedicated repository using Ginkgo and a custom BDD library named bdd for behavior-driven tests. This approach allows Stream to maintain a consistent testing grammar across the company, facilitating faster development cycles, better code reviews, and onboarding of new hires. The company is also working on Cucumber-like feature tests and encourages experimentation with testing methodologies to improve software quality.