generate-unit-test

Generate CI-ready unit tests covering normal, boundary, and exception scenarios.

31|1|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/Ascend/agent-skills --skill generate-unit-test-ascend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-unit-test
Source: https://github.com/Ascend/agent-skills/tree/main/skills/mindspeed-llm-auto-ut-skills/skills/generate-unit-test
Command: npx skills add https://github.com/Ascend/agent-skills --skill generate-unit-test-ascend

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers automatically generate maintainable, extensible unit tests for functions and classes, ensuring coverage of normal paths, boundary conditions, and error scenarios.

Core Features & Use Cases

  • From the unit under test, extract inputs, outputs, and side effects to drive test cases
  • Design test sets that cover happy path, boundary, and exceptional paths
  • Produce clear assertions and CI-ready test code that can be integrated into pipelines

Quick Start

请将需要测试的函数或类的代码或模块标注给 Skill,它将自动生成测试用例并存放在 tests/auto_ut 目录中。

Frequently Asked Questions about generate-unit-test

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

FAQPage Schema
How do I automatically generate unit tests for Python functions and classes?

To automatically generate unit tests, provide your target code or module to the Skill. It extracts inputs, outputs, and side effects, then produces CI-ready test files under the tests/auto_ut directory.

Can I generate pytest test cases that cover boundary and exception scenarios?

Yes, you can generate pytest test cases covering normal, boundary, and exception scenarios. The Skill designs test sets by capturing side effects from the target code to drive comprehensive assertions.

How does automated test generation handle CI-ready test file creation?

Automated test generation creates CI-ready test files by identifying tested behavior and capturing inputs and outputs. It validates these generated files using the run-mindspeed-llm-test workflow.

What is the best way to create maintainable unit tests for existing code?

The best way to create maintainable unit tests is to extract side effects and input-output mappings from the unit under test. This drives clear assertions for happy paths and exceptional paths.

Do I need to set up a specific directory structure for automated unit test generation?

Yes, automated unit test generation requires a designated output location. The Skill automatically stores the generated CI-ready test code in the tests/auto_ut directory within your project.

What does automated unit test generation extract from the target code to design test cases?

Automated unit test generation extracts tested behavior, inputs, outputs, and side effects from the target code. This extracted data drives the design of test cases covering normal and exceptional paths.