Tecnologia & Testing Nucleo B · Guida ufficiale Piattaforma: Generale

Unit Test

Test unitario

Un test unitario verifica un piccolo pezzo di software da solo. Sistemi esterni lenti o inaffidabili vengono tenuti fuori dal test.

Vedi come funziona
Potresti chiamarlo Unit TestTest unitario

Vedi come funziona

Esempio originale svoltoTest unitario

Un altro esempio

Uno sviluppatore testa una funzione di prezzo con una tabella delle tasse e diversi valori di esempio. I totali devono essere esatti senza avviare una rete o un database. Un test che avvia l'intero servizio e un database reale non è un test unitario.

Parti principali

  1. 01unità in test
  2. 02Dipendenza controllata
  3. 03affermazione del focus

Usalo quando

Usa questo termine per un controllo veloce e locale di un comportamento con dipendenze controllate.

Non usarlo quando

Non falsare il comportamento che il test deve verificare. Un test unitario non può dimostrare che l'intero sistema funzioni insieme.

Nome usato nel codice

arrange → act → assert

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.

Puoi copiare la richiesta

Outcome: Complete the task with Test unitario (Unit Test). User context: Uno sviluppatore testa una funzione di prezzo con una tabella delle tasse e diversi valori di esempio. I totali devono essere esatti senza avviare una rete o un database. Un test che avvia l'intero servizio e un database reale non è un test unitario. Validation approach: Test unitario (Unit Test). Why it fits: Usa questo termine per un controllo veloce e locale di un comportamento con dipendenze controllate. Do not use it when: Non falsare il comportamento che il test deve verificare. Un test unitario non può dimostrare che l'intero sistema funzioni insieme. 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 unitario (Unit Test) is used now. Definition: Un test unitario verifica un piccolo pezzo di software da solo. Sistemi esterni lenti o inaffidabili vengono tenuti fuori dal test. 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.

B
Quanto è ufficiale questo termine?

Guida ufficiale

La piattaforma, il framework, il progetto o il gruppo di esperti nominato ha una guida ufficiale per questo termine.

È ufficiale per quella fonte. Altre piattaforme o team potrebbero usare il termine in modo diverso.

Ambito
Solo ciò che la sorgente copre:nome canonico、definizione、guida all'uso、linee guida per l'evitamento
stato del documento
stabile
Selezionato attivato
2026-07-30

Fonti e ambito delle prove

Fonte dell'autorità + Riferimento del termine · International Software Testing Qualifications Board · stabile ISTQB Glossary Ambito: nome canonico、definizione、guida all'uso、linee guida per l'evitamento Ruolo qui: Riferimento diretto al termine La fonte copre: nome canonico, definizione, guida all'uso, linee guida per l'evitamento

Copia tu stesso

Il browser non è riuscito a copiare questo. Seleziona la richiesta qui sotto e copiala tu stesso.