Reverse-Engineering Legacy Search with Integration Tests

How I used integration tests to document and understand an OpenSearch query system nobody could explain -- and caught a breaking change within a week.