Why Integration Tests Might be Better than Unit Tests
summary
Argues that for FerretDB (a MongoDB-compatible server in Go with a PostgreSQL backend) integration tests catch real incompatibilities that unit tests missed, for example an empty-array filtering edge case that broke compatibility. Uses the official MongoDB Go driver to compare results against MongoDB, prepares dozens of real collections with varied data, runs the MongoDB test suites plus custom queries, and keeps a few focused unit tests. CI initially takes ~30 minutes so the suite is sharded CI to run tests in parallel, yielding faster feedback and clearer prioritization of missing features and documented incompatibilities.
AI-written summary · about
chapters (11)
- 0:00Intro
- 0:28What do you like about testing
- 5:19The data
- 8:08Filtering
- 13:52Unit tests are harmful
- 14:13What GPT thinks
- 14:59Why unit tests may not be enough
- 16:28Functionality
- 18:14Compatibility
- 19:18Unit Tests
- 20:43Running Integration Tests on CI
related talks
43mFerretDB — mongoDB on the outside, PostgreSQL on the inside
44mTesting: Integration Tests - The good, bad and ugly
39mHow to test Go code with a database?
56mIf You Won't Test Your Code, Who Will?
35mTest like a ninja with Go
06mIntegration Testing with TestContainers-Go
35mDIY (Do-it-Yourself) Testing
20mWriting Microservice Integration Tests in Go (Finally)
