Software Testing Engineering / API & CONTRACT TESTING / TST-020
Contract Drift
Explore concept graphLatihan soal
Jalankan drift checker
Dari root repository dengan Node 24:
node generation/fixtures/TST-020/contract-drift.mjsOutput yang diharapkan:
baseline-response=valid
additive-optional=tolerant-accept
required-removal=detected
amount-type-change=detected
new-required=detected
payload-missing-and-type=detected
payload-enum=detected
strict-consumer=rejects-unknown
runtime=static-fixture-onlyChecker membaca sumber SYS-008 asli, lalu menjalankan perubahan pada salinan memori. Semua mutasi breaking wajib ditolak oleh assertion. Fixture ini bukan validator lengkap JSON Schema/OpenAPI, bukan Pact, dan bukan integration test Spring MVC.
Konsep 1 / 3
Detect removed required response guarantees against an older provider contract.
Coba prediksi atau perbaiki
Is removing a field from a provider response required array always backward-compatible?
Kalau jawabanmu berbeda
Kesalahan yang mungkin: Assuming a changed provider response remains compatible because the HTTP status is unchanged.
Mengapa tidak bekerja: Clients deserialize required JSON keys and types, not only the status line.
Coba perbaiki: Compare the baseline provider guarantee and exercise a deliberately breaking response mutation.
Periksa hasil sendiri
Hasil yang diharapkan: A missing required guarantee is rejected.
Kalau berbeda: Compare the tracked SYS-008 OpenAPI response and the mutated candidate without editing the baseline.
Konsep 2 / 3
Detect breaking type changes and malformed response instances independently.
Coba prediksi atau perbaiki
Why test both changed schemas and actual response bodies?
Kalau jawabanmu berbeda
Kesalahan yang mungkin: Assuming a changed provider response remains compatible because the HTTP status is unchanged.
Mengapa tidak bekerja: Clients deserialize required JSON keys and types, not only the status line.
Coba perbaiki: Compare the baseline provider guarantee and exercise a deliberately breaking response mutation.
Periksa hasil sendiri
Hasil yang diharapkan: Both schema change and payload mutation are rejected.
Kalau berbeda: Compare the tracked SYS-008 OpenAPI response and the mutated candidate without editing the baseline.
Konsep 3 / 3
Test optional field additions with both tolerant and strict legacy consumers.
Coba prediksi atau perbaiki
Does a new optional field guarantee that every consumer remains compatible?
Kalau jawabanmu berbeda
Kesalahan yang mungkin: Assuming a changed provider response remains compatible because the HTTP status is unchanged.
Mengapa tidak bekerja: Clients deserialize required JSON keys and types, not only the status line.
Coba perbaiki: Compare the baseline provider guarantee and exercise a deliberately breaking response mutation.
Periksa hasil sendiri
Hasil yang diharapkan: Tolerant response passes while strict consumer rejects unknown memo.
Kalau berbeda: Compare the tracked SYS-008 OpenAPI response and the mutated candidate without editing the baseline.
Lima soal Contract Drift
Jawab tanpa melihat pembahasan dulu. Kamu bisa memperbaiki jawaban dan mencoba lagi. Kuis ini latihan mandiri dan tidak menyimpan skor atau progres.