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

REST Contract Matrix

Explore concept graph

Praktik dan verifikasi mandiri

Independent Project — REST Contract Matrix

Konsep 1 / 3

Compare the required workbook status set to the exact responses promised by SYS-008 OpenAPI.

For GET /accounts/{id}, evaluate whether an undocumented 409 response is contract-compliant.

Kasus yang berbeda dari contoh: GET account 409 is a different operation and failure category than POST transfer 422.

Bukti yang bisa kamu periksa

  • A per-operation status/header matrix with an explicit explanation of the 422 gap.

Jika ingin lanjut

Run live local HTTP requests against the response matrix.

Jika terputus: Begin from POST 201 and its two error families, then inspect GET.

Konsep 2 / 3

Run ten real HTTP requests to a local server and verify positive and negative responses.

Add a new GET account fixture and verify both 200 and 404 with different IDs.

Kasus yang berbeda dari contoh: Read a new account not used in the transfer creation example.

Bukti yang bisa kamu periksa

  • 10 HTTP checks with statuses and headers plus an independent account request variant.

Jika ingin lanjut

Prove the checker rejects deliberately malformed responses.

Jika terputus: Follow the path from spec to request to actual header and JSON body.

Konsep 3 / 3

Reject invalid Problem Details, missing 401 challenge and a breaking amount type mutation.

Mutate GET account 200 to omit a required currency field and show the checker rejects it.

Kasus yang berbeda dari contoh: An omitted Account.currency differs from the Transfer.amount type mismatch worked example.

Bukti yang bisa kamu periksa

  • Three mutation rejections and a separately demonstrated missing required field failure.

Jika ingin lanjut

Repeat the same test matrix against Spring MockMvc or a running isolated application.

Jika terputus: Start with the RFC 9457 body-to-wire invariant, then verify Location and amount typing.

REST Contract Matrix — independent HTTP verification

Uji SYS-008 dengan contract oracle terpisah dari server target. Tambahkan kasus yang berbeda dari stub, atau jalankan kontrak sama terhadap aplikasi Spring MVC yang benar-benar hidup, dan jangan laporkan 422 lulus sebelum OpenAPI direvisi.

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

Kriteria selesai

  • Daftarkan tiga method/path dengan status 200, 201, 400, 401, 403, 404, 409 dan 500 yang memang dideklarasikan.
  • Laporkan status 422 sebagai gap di OpenAPI SYS-008, bukan secara fiktif mengubah 400 ke 422.
  • Kirim real HTTP requests dan periksa 201 Location, 401 WWW-Authenticate serta Content-Type setiap respons.
  • Validasi required schema fields, JSON type, enum dan pattern serta Problem Details type/title/status.
  • Buktikan response body status salah, challenge 401 hilang, dan amount number ditolak oleh checker.
  • Uji skenario GET account lain dan jalankan minimal satu failure case berbeda dari worked example.
  • Tulis batas verifikasi: Node loopback stub tidak membuktikan Spring MVC, JWT, database, consumer compatibility atau financial settlement.

Kriteria verifikasi mandiri

  • Mampu membedakan HTTP status RFC yang tersedia dengan status yang dideklarasikan dalam OpenAPI.
  • Bisa membaca hasil 10 HTTP round-trips, termasuk success dan negative cases.
  • Mendeteksi header, Problem Details dan breaking JSON field type.
  • Tidak menyamakan verified educational fixture dengan tested production API.