Contract Testing Engineer
Stop integration surprises: consumer-driven contracts, drift detection, OpenAPI fuzzing, golden files, schema compatibility gates, and deprecation with sunset headers.
Path overview
契约测试把接口对不对从集成环境前移到 PR 阶段。本路径从契约漂移的成因讲起,覆盖向后兼容与模式演进的判定规则,再落地契约测试、模糊测试、黄金文件与兼容性门禁四个配方,收尾于废弃流程与评审工作流。
Contract testing moves is-the-interface-right from integration environments to pull requests. This path covers drift, compatibility rules, fuzzing, golden files, gates, and deprecation.
Apply "Add an OpenAPI Contract Test" to a contract testing task, checking that "Run property-based tests against a disposable server so generated requests exercise the" appears after the "Every documented operation returns responses that match the schema, or the failing" step.
Next step: Fuzz the API Against Its OpenAPI Schema
⏱ 0.5h
Execute "Fuzz the API Against Its OpenAPI Schema" end to end, then repeat the last step with one parameter changed and compare "Generate malformed and edge-case requests from the API schema to find unhandled 500".
Prerequisites: Add an OpenAPI Contract Test
Next step: Add Golden File Tests for API Responses
⏱ 0.5h
Run "Detect unintended API response changes with committed golden files that are updated" from "Add Golden File Tests for API Responses" and confirm the documented result "UPDATE_GOLDEN=1 creates or rewrites the file; a normal run compares and fails with the file".
Prerequisites: Fuzz the API Against Its OpenAPI Schema
Next step: Gate Deploys on Schema Compatibility
⏱ 0.5h
Apply "Gate Deploys on Schema Compatibility" to a contract testing task, checking that "{compatibility:BACKWARD}" appears after the "Catch breaking event schema changes in pull requests instead of discovering them when" step.
Prerequisites: Add Golden File Tests for API Responses
Next step: Add API Deprecation Headers
⏱ 0.5h
Execute "Add API Deprecation Headers" end to end, then repeat the last step with one parameter changed and compare "The dashboard shows which clients still depend on the old endpoint.".
Prerequisites: Gate Deploys on Schema Compatibility
Next step: Review API Contract Changes Before Merge
⏱ 0.5h
Follow "Review API Contract Changes Before Merge" and record "Classify each change: Mark additions as compatible and removals, required additions, type" at the step where it should appear, using "No breaking change merges without an owner and a date." as the check.
Prerequisites: Add API Deprecation Headers
Next step: Detect Breaking Changes Between API Contracts
⏱ 0.5h
Turn JSON object: { oldSpec: { paths, fields, required }, newSpec: { into [field-removed:name,path-removed:/users/{id},required-added:tenantId] by completing "Detect Breaking Changes Between API Contracts" with a reproducible script and a failing-case note.
Prerequisites: Review API Contract Changes Before Merge
Next step: Capstone: Contract Testing Engineer
⏱ 0.42h
Build "Build a Schema Registry Service" through its phases, keeping "Compatibility checker" independently testable.
Prerequisites: Review API Contract Changes Before Merge, Detect Breaking Changes Between API Contracts
Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.
⏱ 4h