← 返回
未分类 中文

Tests Generator

Generate deterministic unit/integration tests for critical behaviors.
为关键行为生成确定性单元/集成测试
mzfshark mzfshark 来源
未分类 clawhub v1.0.0 1 版本 99692.3 Key: 无需
★ 0
Stars
📥 324
下载
💾 0
安装
1
版本
#dev#latest

概述

SKILL: test-generator

Purpose

Generate deterministic unit/integration tests that protect behavior and enable safe refactors.

When to Use

  • A feature needs coverage.
  • A bug fix needs a regression test.
  • You want characterization tests before refactoring.

Inputs

  • target (required, string): function/module/endpoint/contract behavior to test.
  • test_type (optional, enum: unit|integration|e2e).
  • framework (optional, string): e.g., pytest, jest, vitest, foundry, hardhat.
  • constraints (optional, string[]): no network, deterministic time, limited mocks, etc.

Steps

  1. Identify observable behaviors and edge cases.
  2. Decide test boundaries:
    • unit: pure logic
    • integration: DB/service boundary
  3. Create fixtures:
    • deterministic data
    • stable clocks/UUIDs (mock only when required)
  4. Write tests:
    • happy path
    • failure paths
    • security/validation checks (where applicable)
  5. Run tests and iterate until they are stable.

Validation

  • Tests are deterministic (no flaky time/network dependencies).
  • Tests fail before the fix (for regressions) and pass after.
  • Coverage targets the acceptance criteria, not implementation details.

Output

  • Test files added/changed
  • How to run tests
  • Notes on fixtures/mocks used

Safety Rules

  • Do not add tests that require real credentials or real external services by default.
  • Avoid snapshot tests for highly variable outputs unless stabilized.

Example

Bug: “User creation accepts invalid email.”

Output: a failing test asserting 400 on invalid input, then passes after fix.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 21:15 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Axodus Trading Integration

mzfshark
Integrate trading infrastructure (hummingbot/MCP) with paper-first mode and audit logs.
★ 0 📥 463

Community Onboarding

mzfshark
引导新用户主动参与;简明解释 $NEURONS 并提供安全的后续操作。
★ 0 📥 450

Matrix Detection

mzfshark
识别幻觉、炒作、虚假叙事和系统性操纵;按证据和风险标签区分信号与噪音。
★ 0 📥 452