Test Case
Caso di test
Un Test Case controlla un comportamento o un rischio. Indica la configurazione di partenza, l'azione e il risultato atteso.
Un altro esempio
Un reset della password usa un link scaduto e invia una nuova password. Non si aspetta alcuna modifica all'account e mostra un messaggio sicuro per il recupero.
Parti principali
- 01Code or behavior under test
- 02Observable evidence
- 03Coverage, failure, and recovery
Usalo quando
Usalo per comportamenti importanti che devono essere ripetibili. Indica configurazione, dati, passaggi e risultato.
Non usarlo quando
Non scrivere casi vaghi come “test login.” Evita dettagli di codice e controlli non correlati.
Nome usato nel codice
Given setup → When action → Then observation 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 Caso di test (Test Case). User context: Un reset della password usa un link scaduto e invia una nuova password. Non si aspetta alcuna modifica all'account e mostra un messaggio sicuro per il recupero. Validation approach: Caso di test (Test Case). Why it fits: Usalo per comportamenti importanti che devono essere ripetibili. Indica configurazione, dati, passaggi e risultato. Do not use it when: Non scrivere casi vaghi come “test login.” Evita dettagli di codice e controlli non correlati. 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): Nessun singolo standard ufficiale controlla l'intero termine. Il suo significato può cambiare tra team, piattaforme o framework. Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
Controlla questa richiesta
Review how Caso di test (Test Case) is used now. Definition: Un Test Case controlla un comportamento o un rischio. Indica la configurazione di partenza, l'azione e il risultato atteso. 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.