Contract Testing
Test del contratto
Il test del contratto verifica se due sistemi che possono essere distribuiti separatamente scambiano ancora messaggi nel formato concordato.
Un altro esempio
Un client si aspetta che GET /profiles/42 restituisca determinati campi e uno stato. L'integrazione continua (CI) verifica che il provider mantenga questa promessa. Il test non dimostra l'intero percorso né la qualità dei dati live.
Parti principali
- 01contratto del consumatore
- 02verifica del fornitore
- 03risultato di compatibilità
Usalo quando
Usa questo termine quando i servizi vengono distribuiti autonomamente e la compatibilità dei messaggi deve essere verificata senza l'intero sistema.
Non usarlo quando
Non copiare il codice privato del fornitore nel contratto o usare questo test al posto della verifica della sicurezza dell'API.
Nome usato nel codice
consumer expectation ↔ provider verification Prima di spedire
Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule.
Outcome: Complete the task with Test del contratto (Contract Testing). User context: Un client si aspetta che GET /profiles/42 restituisca determinati campi e uno stato. L'integrazione continua (CI) verifica che il provider mantenga questa promessa. Il test non dimostra l'intero percorso né la qualità dei dati live. Validation approach: Test del contratto (Contract Testing). Why it fits: Usa questo termine quando i servizi vengono distribuiti autonomamente e la compatibilità dei messaggi deve essere verificata senza l'intero sistema. Do not use it when: Non copiare il codice privato del fornitore nel contratto o usare questo test al posto della verifica della sicurezza dell'API. Test requirements: Name the system and test environment. Define prepared test data, other inputs, and the result you can observe. Include failure and edge cases, allowed error, isolation, and cleanup. Test operations: Make failures easy to diagnose. Control random or changing inputs. Name an owner. Keep the test fast and simple enough for its release gate. Acceptance criteria: The test fails for the known bug and passes after the fix. It repeats in the target environment, gives useful evidence, and does not expose or change unrelated data. Evidence and limits (evidence boundary): È ufficiale per quella fonte. Altre piattaforme o team potrebbero usare il termine in modo diverso. Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
Controlla questa richiesta
Review how Test del contratto (Contract Testing) is used now. Definition: Il test del contratto verifica se due sistemi che possono essere distribuiti separatamente scambiano ancora messaggi nel formato concordato. Release checks: Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.