Vai al contenuto
MathWorks

Corsi online da autodidatta

  • Self-Paced Content
  • MathWorks
  • MATLAB Help Center
  • Community
  • Apprendimento
  • Acquista MATLAB MATLAB
  • Accedi
    • Il Mio Account
    • Il mio Profilo utente
    • Associa Licenza

    • Disconnettiti
  • Contatta l’assistenza MathWorks
  • Visit mathworks.com
  • Online Courses
MathWorks MathWorks

Seleziona un sito web

Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .

  • (English)
  • (Deutsch)
  • (Français)
  • (简体中文)
  • (English)

Puoi anche selezionare un sito web dal seguente elenco:

Come ottenere le migliori prestazioni del sito

Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.

Americhe

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europa

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia-Pacifico

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文
    • English
  • 日本 (日本語)
  • 한국 (한국어)

Contatta l’ufficio locale

image for course Test unitari

Test unitari

Impara a scrivere test unitari efficaci per migliorare la qualità del codice, prevenire i bug e verificare il comportamento desiderato. Comprendi i concetti di test, scrivi script e funzioni di test e gestisci le attività pre-test e post-test.

Moduli del corso

Introduction

Get an overview of the content covered.

Lezioni:
  • Course Overview
  • Learning Outcomes and Prerequisites
  • Course Example
  • What is Unit Testing?

What is a Test?

Write tests with comparisons, functions that test equality, and assert statements.

Lezioni:
  • Elements of a Test
  • is* Functions
  • Compare with == Versus isequal
  • Test Response
  • Assert Statements

Test as You Go with a Test Script

Combine tests into a test script, and run tests on your code base.

Lezioni:
  • Why Use a Test Script?
  • The Format of a Test Script
  • Write a Test Script
  • Test Script Results
  • Run a Test Script
  • Fix Broken Tests

Avoid Bugs in Comparisons

Use tests that make numeric comparisons within a given tolerance.

Lezioni:
  • Bugs in Comparisons
  • Numerical Precision
  • Check for Equality (Within a Given Tolerance)
  • Add a Tolerance to Satellite Application Tests

Write Test Functions

Write test functions to test the output and behavior of programs.

Lezioni:
  • Why Use Test Functions?
  • The Format of a Test Function
  • Convert Satellite Parameters Tests to Test Functions

Verify Behavior

Use functions that verify application behavior.

Lezioni:
  • Verify Application Behavior
  • Verification Functions
  • Satellite Parameters Tests Using verifyTrue
  • Other verify* Functions

Test for Desired Warnings and Errors

Verify programs produce the correct warnings and errors.

Lezioni:
  • Commands as Inputs to Test
  • Test for an Expected Error Message - Satellite Application
  • Test for an Expected Error Message - Square Root Function

Add Pre- and Post- Test Tasks

Define set-up tasks for testing, and undo them when finished.

Lezioni:
  • What Are Pre- and Post-Test Tasks?
  • The Format of Pre- and Post- Test Tasks
  • Pre- and Post- Test Tasks for Satellite Parameters Tests

Conclusion

Review course content, learn next steps, and provide feedback on the course.

Lezioni:
  • Summary
  • Additional Resources
  • Survey

Formato:Autogestito

Lingua:Italiano

Lingua

  • Esercizi pratici con feedback automatico
  • Accedi a MATLAB tramite il browser web
  • Report sui progressi e certificato del corso condivisibili

Il come e il perché delle funzioni di scrittura

Aumenta la flessibilità del codice scrivendo funzioni personalizzate.

  • Centro di fiducia
  • Marchi
  • Informativa sulla privacy
  • Antipirateria
  • Stato dell'applicazione
  • Contatti

© 1994-2025 The MathWorks, Inc.