Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

characterization-test-generator

БесплатноБез исполняемых скриптовНе проверен

Generate characterization tests to capture and verify existing behavior before migration

a5c-aiот a5c-ai★ 1 947 звёзд на GitHub

Об этом скилле

Characterization Test Generator Skill

Generates characterization tests (also known as golden master tests or approval tests) to capture existing system behavior before migration, ensuring functional equivalence after changes.

Purpose

Enable behavior preservation during migration through:

  • Golden master test creation
  • Approval test generation
  • Edge case discovery
  • Input/output recording
  • Behavior snapshot capture
  • Regression baseline establishment

Capabilities

1. Golden Master Test Creation

  • Capture current system outputs for given inputs
  • Store outputs as reference "golden" files
  • Generate comparison test infrastructure
  • Support multiple output formats
  • Enable baseline versioning

2. Approval Test Generation

  • Create human-reviewable test outputs
  • Generate diff-based comparison tests
  • Support approval workflows
  • Enable incremental approval
  • Track approval history

3. Edge Case Discovery

  • Analyze code paths for boundary conditions
  • Generate boundary value inputs
  • Identify error handling scenarios
  • Map exception paths
  • Create comprehensive test coverage

4. Input/Output Recording

  • Instrument code for I/O capture
  • Record API request/response pairs
  • Capture database interactions
  • Log external service calls
  • Store timing and sequence data

5. Behavior Snapshot

  • Capture state at key points
  • Record side effects
  • Document non-deterministic behavior
  • Identify environmental dependencies
  • Map configuration impacts

6. Regression Baseline Establishment

  • Create baseline test suites
  • Define acceptance thresholds
  • Configure tolerance levels
  • Set up CI/CD integration
  • Generate coverage reports

Tool Integrations

This skill can leverage the following external tools when available:

Tool Purpose Integration Method
ApprovalTests Approval testing framework Library
Jest snapshots JavaScript snapshot testing Framework
pytest-snapshot Python snapshot testing Plugin
TextTest Golden master testing CLI
Verify .NET approval testing Library
Scientist Safe refactoring library Library
AI Testing MCP AI-powered test generation MCP Server

Usage

Basic Test Generation

# Invoke skill for characterization test generation
# The skill will analyze code and generate tests

# Expected inputs:
# - targetPath: Path to code to characterize
# - testFramework: 'jest' | 'pytest' | 'junit' | 'nunit' | 'auto'
# - outputDir: Directory for generated tests
# - captureMode: 'snapshot' | 'approval' | 'recording'

Generation Workflow

  1. Analysis Phase

    • Identify testable units (functions, methods, endpoints)
    • Map input parameters and types
    • Detect output formats
    • Find external dependencies
  2. Input Discovery Phase

    • Extract existing test inputs
    • Generate boundary values
    • Identify representative cases
    • Create combinatorial inputs
  3. Capture Phase

    • Execute code with inputs
    • Record outputs and side effects
    • Capture state changes
    • Log external interactions
  4. Test Generation Phase

    • Generate test code structure
    • Create golden master files
    • Set up comparison logic
    • Configure CI integration

Output Schema

{
  "generationId": "string",
  "timestamp": "ISO8601",
  "target": {
    "path": "string",
    "language": "string",
    "framework": "string",
    "unitsAnalyzed": "number"
  },
  "testsGenerated": {
    "total": "number",
    "byType": {
      "snapshot": "number",
      "approval": "number",
      "recording": "number"
    },
    "coverage": {
      "functions": "number",
      "branches": "number",
      "lines": "number"
    }
  },
  "characterizations": [
    {
      "unit": "string",
      "type": "function|method|endpoint|class",
      "inputs": [
        {
          "name": "string",
          "type": "string",
          "values": ["any"],
          "source": "existing|generated|boundary"
        }
      ],
      "outputs": {
        "type": "string",
        "goldenMasterPath": "string",
        "checksum": "string"
      },
      "testFile": "string",
      "baselineApproved": "boolean"
    }
  ],
  "edgeCases": [
    {
      "unit": "string",
      "case": "string",
      "input": "any",
      "expectedBehavior": "string",
      "covered": "boolean"
    }
  ],
  "dependencies": {
    "external": ["string"],
    "mocked": ["string"],
    "recorded": ["string"]
  },
  "artifacts": {
    "testSuite": "string",
    "goldenMasters": "string",
    "recordings": "string",
    "coverageReport": "string"
  }
}

Integration with Migration Processes

This skill integrates with the following Code Migration/Modernization processes:

  • migration-testing-strategy: Primary tool for test baseline creation
  • code-refactoring: Ensure behavior preservation during refactoring
  • framework-upgrade: Verify functionality after upgrade
  • monolith-to-microservices
Полный SKILL.md на GitHub

Установить characterization-test-generator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Write
Grep
Glob
Edit

Вложенные файлы

README.md

FAQ

Что делает скилл characterization-test-generator?

Generate characterization tests to capture and verify existing behavior before migration

Как установить скилл characterization-test-generator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл characterization-test-generator запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить characterization-test-generator с