Skip to main content
After extracting microservices from the engine monolith, go test ./... failed with 2 compile errors — test files referenced types and functions from deleted source code. Rather than deleting the tests (losing coverage) or importing external services (re-coupling), we derived the missing types from test assertions. Test literal construction like PluginConfig{Enabled: true, Timeout: 30*time.Second} tells you the exact struct definition. Test function calls like formatBytes(1024) tell you the signature. Integration tests referencing removed repos were tagged with //go:build integration — preserved but excluded from default runs. Key learning: Tests are executable specifications. When source code is removed but tests remain, the tests contain everything needed to reconstruct the contract. This is faster and more accurate than writing types from memory or documentation.