Software Testing Engineering / API & CONTRACT TESTING / TST-020

Contract Drift

Explore concept graph

Praktik dan verifikasi mandiri

Project — Independent Contract Compatibility Gate

Konsep 1 / 3

Detect removed required response guarantees against an older provider contract.

Repeat the test with createdAt removed from required instead of currency.

Kasus yang berbeda dari contoh: Assess an audit timestamp rather than the currency demonstration.

Bukti yang bisa kamu periksa

  • A missing required guarantee is rejected.

Jika ingin lanjut

Inspect the next candidate and run the bounded Node fixture.

Jika terputus: Return to the eight baseline Transfer required fields.

Konsep 2 / 3

Detect breaking type changes and malformed response instances independently.

Check that the GET Account response rejects a numeric currency field.

Kasus yang berbeda dari contoh: Use a different DTO and field instead of the Transfer amount example.

Bukti yang bisa kamu periksa

  • Both schema change and payload mutation are rejected.

Jika ingin lanjut

Inspect the next candidate and run the bounded Node fixture.

Jika terputus: Return to the eight baseline Transfer required fields.

Konsep 3 / 3

Test optional field additions with both tolerant and strict legacy consumers.

Replace memo with an optional displayTag and validate the two consumer behaviors.

Kasus yang berbeda dari contoh: Try a different optional property on a new consumer fixture.

Bukti yang bisa kamu periksa

  • Tolerant response passes while strict consumer rejects unknown memo.

Jika ingin lanjut

Inspect the next candidate and run the bounded Node fixture.

Jika terputus: Return to the eight baseline Transfer required fields.

Contract Drift — detect breaking response evolution

Pertahankan SYS-008 baseline lalu uji kandidat perubahan. Buktikan penghapusan required field dan type mutation membuat checker gagal; buktikan optional field baru hanya kompatibel untuk consumer yang mendukungnya.

Latihan manual — jalankan sendiri di lingkunganmu. Kriteria di bawah adalah pemeriksaan mandiri, bukan penilaian otomatis.

Kriteria selesai

  • Gunakan Transfer response schema dari OpenAPI SYS-008 yang benar-benar ditrack.
  • Tolak penghapusan field wajib dan perubahan tipe amount string menjadi number.
  • Tolak actual response tanpa currency, invalid enum EUR, dan field baru yang menjadi required.
  • Tunjukkan optional memo diterima oleh tolerant consumer tetapi strict client dapat menolaknya.
  • Jalankan Node contract-drift checker, dengan semua intentional breaking mutations terdeteksi.
  • Uji satu kasus berbeda menggunakan Account atau optional displayTag, bukan mengulang worked example.
  • Bedakan static spec/instance fixture dari pemeriksaan consumer/provider production yang nyata.

Kriteria verifikasi mandiri

  • Mampu membedakan schema drift dari actual payload drift.
  • Memahami arah kompatibilitas respons dari provider ke consumer.
  • Dapat membuktikan breaking response changes gagal pada fixture.
  • Tidak mengklaim semua client kompatibel hanya karena optional field lolos schema check.