Skip to content
Back to skills

Metamorphic Test Generator

ASecurity

Generate test cases using metamorphic testing by applying transformations based on metamorphic properties. Use when you need to expand test suites, test programs without oracles, validate mathematical or algorithmic properties, or detect subtle bugs through input-output relationships. The skill takes a program, original test cases, and metamorphic properties as input, generates new test cases by applying transformations, executes tests, verifies outputs satisfy properties, reports violations ...

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 27, 2026
developmentpythongobashtesting

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add ArabelaTso/Skills-4-SE --skill metamorphic-test-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Metamorphic Test Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Metamorphic Test Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/arabelatso-metamorphic-test-generator/badge)](https://www.skillsdirectory.com/skills/arabelatso-metamorphic-test-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: metamorphic-test-generator
description: Generate test cases using metamorphic testing by applying transformations based on metamorphic properties. Use when you need to expand test suites, test programs without oracles, validate mathematical or algorithmic properties, or detect subtle bugs through input-output relationships. The skill takes a program, original test cases, and metamorphic properties as input, generates new test cases by applying transformations, executes tests, verifies outputs satisfy properties, reports violations and anomalies, and outputs an expanded test suite with property coverage summary. Supports multiple programming languages and property types.
---

# Metamorphic Test Generator

## Overview

This skill generates test cases using metamorphic testing, applying transformations based on metamorphic properties to expand test suites and detect bugs through input-output relationships.

## Quick Start

```bash
# Generate metamorphic tests
python scripts/generate.py program.py --tests tests/ --properties properties.json

# Use specific metamorphic properties
python scripts/generate.py program.py --tests tests/ --properties "permutation,addition"

# Generate report
python scripts/generate.py program.py --tests tests/ --properties props.json --output report.json
```

## What Gets Generated

1. **Follow-up Test Cases** - New inputs derived from original tests
2. **Property Verification** - Checks that outputs satisfy metamorphic relations
3. **Violation Reports** - Identifies property violations and anomalies
4. **Expanded Test Suite** - Original plus generated tests
5. **Coverage Summary** - Property coverage and effectiveness

## Common Metamorphic Properties

- **Permutation** - Reordering inputs should not affect output
- **Addition** - Adding elements should increase/maintain result
- **Multiplication** - Scaling inputs should scale outputs proportionally
- **Inverse** - Applying inverse operation should return original
- **Equivalence** - Different representations should yield same result
- **Monotonicity** - Increasing input should increase/maintain output

## Test Generation Report

Generates detailed report with:
- **Original Tests** - Initial test cases count
- **Generated Tests** - New test cases created
- **Properties Applied** - Metamorphic relations used
- **Violations Found** - Property violations detected
- **Property Coverage** - Percentage of properties satisfied
- **Anomalies** - Unexpected behaviors identified

Example report:
```json
{
  "original_tests": 20,
  "generated_tests": 60,
  "properties_applied": ["permutation", "addition", "inverse"],
  "violations": 3,
  "property_coverage": 95.0,
  "anomalies": ["inverse property failed for negative inputs"]
}
```

## Usage

```bash
python scripts/generate.py <program> --tests <test_dir> --properties <properties> [--output <report.json>]
```

## Tips

- Define properties based on program semantics
- Start with simple properties (permutation, addition)
- Use metamorphic testing when oracles are unavailable
- Violations often indicate real bugs
- Combine with traditional testing for best results
- Document properties for future test maintenance

Files in this skill

  • README.md3.4 KB
  • SKILL.md3.1 KB
  • assets/example-program.py759 B
  • assets/properties-template.json241 B
  • assets/test-cases-template.json327 B
  • references/properties.md4 KB
  • scripts/generate.py21.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.