matlab-test-generator

Generate MATLAB test classes, methods, and suites using the MATLAB Testing Framework.

Updated Feb 7, 2025
One-click install
npx skills add https://github.com/MahZadYar/urchin --skill matlab-test-generator-mahzadyar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-test-generator
Source: https://github.com/MahZadYar/urchin/tree/main/.github/skills/matlab-test-generator
Command: npx skills add https://github.com/MahZadYar/urchin --skill matlab-test-generator-mahzadyar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides MATLAB developers to write robust, well-structured unit tests using the MATLAB Testing Framework. It covers test classes, test methods, fixtures, and test suites to improve reliability and maintainability.

Core Features & Use Cases

  • Generate test classes, test methods, and test suites following MATLAB best practices
  • Support fixtures, parameterized tests, setup/teardown methods, and test tagging for flexible configurations
  • Provide templates and examples for script-, function-, and class-based tests, including private and static methods

Quick Start

Create a new MATLAB test file using the provided templates and run runtests to execute the tests.

Frequently Asked Questions about matlab-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write parameterized MATLAB unit tests with fixtures?

You can generate robust MATLAB unit tests by creating test classes and methods that apply setup/teardown fixtures and parameterization, ensuring reliable and maintainable test suites across your projects.

Does the MATLAB Testing Framework support script-based and function-based tests?

Yes, the framework supports script-, function-, and class-based tests. You can generate templates for each format, including configurations for private and static methods to ensure comprehensive coverage.

What is the best way to structure test suites and tagging in MATLAB?

Structuring MATLAB test suites involves creating test classes with method tagging and parameterization. This allows flexible configuration and organized execution when running tests across your MATLAB projects.

Can I use mock objects in MATLAB unit tests for private methods?

Yes, you can use mock objects in MATLAB unit tests. The framework provides templates supporting mock objects to isolate components and verify interactions when testing private and static methods.

How to runtests after generating a new MATLAB test file?

After generating a MATLAB test file using the provided templates, you run the tests by executing the runtests command, which processes your test classes, methods, and fixtures to validate your code.

When do I need teardown methods in MATLAB unit testing?

Teardown methods are needed in MATLAB unit testing when tests require post-execution cleanup. Generating tests with setup and teardown methods ensures your environment resets properly between runs.