Passer au contenu
MathWorks

Formations en ligne

  • Self-Paced Content
  • MathWorks
  • Centre d’aide MATLAB
  • Communauté
  • Apprendre
  • Obtenir MATLAB MATLAB
  • Connectez-vous
    • Mon compte
    • Mon profil
    • Mes licences

    • Se déconnecter
  • Contactez le support technique MathWorks
  • Visit mathworks.com
  • Formation en ligne
MathWorks MathWorks

Sélectionner un site web

Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .

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

Vous pouvez également sélectionner un site web dans la liste suivante :

Comment optimiser les performances du site

Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.

Amériques

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

Europe

  • 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)

Asie-Pacifique

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

Contactez votre bureau local

image for course Tests unitaires

Tests unitaires

Apprenez à écrire des tests unitaires efficaces pour améliorer la qualité du code, éviter les bugs et vérifier le comportement souhaité. Maîtrisez les concepts des tests, écrivez des scripts et des fonctions de test et gérez les tâches pré- et post-test.

Modules de formation

Introduction

Get an overview of the content covered.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • 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.

Cours :
  • Summary
  • Additional Resources
  • Survey

Format :Autoformation

Langue:Français

Langue

  • Des exercices pratiques avec des corrections automatisées
  • Accès à MATLAB via votre navigateur Internet
  • Certificat de formation et rapport de progression partageable

Pourquoi et comment écrire des fonctions

Augmentez la flexibilité de votre code en écrivant des fonctions personnalisées.

  • Trust Center
  • Marques déposées
  • Politique de confidentialité
  • Lutte anti-piratage
  • Statut des applications
  • Contacts locaux

© 1994-2025 The MathWorks, Inc.