Saltar al contenido
MathWorks

Cursos online a su ritmo

  • Self-Paced Content
  • MathWorks
  • Centro de ayuda de MATLAB
  • Comunidad de usuarios
  • Aprendizaje
  • Obtenga MATLAB MATLAB
  • Inicie sesión
    • Mi Cuenta
    • Mi perfil de la comunidad
    • Asociar Licencia

    • Cerrar sesión
  • Contactar con el soporte de MathWorks
  • Visit mathworks.com
  • Online Courses
MathWorks MathWorks

Seleccione un país/idioma

Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .

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

También puede seleccionar uno de estos países/idiomas:

Cómo obtener el mejor rendimiento

Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.

América

  • 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-Pacífico

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

Comuníquese con su oficina local

image for course Pruebas unitarias

Pruebas unitarias

Aprenda a escribir pruebas unitarias eficaces para mejorar la calidad del código, evitar bugs y verificar el comportamiento deseado. Comprenda los conceptos de prueba, escriba scripts y funciones de prueba, y gestione las tareas previas y posteriores a las pruebas.

Módulos del curso

Introduction

Get an overview of the content covered.

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

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

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

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

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

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

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

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

Lecciones:
  • Summary
  • Additional Resources
  • Survey

Formato:A su ritmo

Idioma:Español

Idioma

  • Ejercicios prácticos con comentarios automáticos
  • Acceda a MATLAB a través de su navegador web
  • Informe de progreso y certificado del curso disponibles para compartir

Cómo y por qué escribir funciones

Aumente la flexibilidad del código escribiendo funciones personalizadas.

  • Centro de confianza
  • Marcas comerciales
  • Política de privacidad
  • Antipiratería
  • Estado de las aplicaciones
  • Información de contacto

© 1994-2025 The MathWorks, Inc.