← ClaudeAtlas

matlab-test-generatorlisted

Create comprehensive MATLAB unit tests using the MATLAB Testing Framework. Use when generating test files, test cases, unit tests, test suites, or when the user requests testing for MATLAB code, functions, or classes.
LiHongwei-cn/lihongwei-cn · ★ 9 · AI & Automation · score 79
Install: claude install-skill LiHongwei-cn/lihongwei-cn
# MATLAB Test Generator This skill provides comprehensive guidelines for creating robust unit tests using the MATLAB Testing Framework. Generate test classes, test methods, and test suites following MATLAB best practices. ## When to Use This Skill - Creating unit tests for MATLAB functions or classes - Generating test suites for existing code - Writing test cases with assertions and fixtures - Creating parameterized tests - Setting up test environments with setup/teardown methods - When user requests testing, test coverage, or mentions unit tests ## MATLAB Testing Framework Overview MATLAB supports multiple testing approaches: 1. **Script-Based Tests** - Simple test scripts with assertions 2. **Function-Based Tests** - Test functions with local functions for each test 3. **Class-Based Tests** - Full-featured test classes (recommended for complex testing) ## Test Class Structure ### Basic Test Class Template ```matlab classdef MyFunctionTest < matlab.unittest.TestCase % Tests for myFunction properties (TestParameter) % Define parameters for parameterized tests end properties % Test fixtures and shared data end methods (TestClassSetup) % Runs once before all tests end methods (TestClassTeardown) % Runs once after all tests end methods (TestMethodSetup) % Runs before each test method end methods (TestMethodTeardown) % Runs after each test method end methods (Te