test-case-generator
БесплатноБез исполняемых скриптовНе проверенGenerate comprehensive test cases including edge cases, stress tests, and counter-examples for algorithm correctness verification. Supports random generation…
от a5c-ai★ 1 947 звёзд на GitHubОб этом скилле
test-case-generator
A specialized skill for generating comprehensive test cases for algorithm verification, including edge cases, stress tests, random inputs, and counter-example finding through brute force oracle comparison.
Purpose
Generate test cases for:
- Correctness verification against problem constraints
- Edge case identification and testing
- Stress testing with large inputs
- Counter-example finding for wrong solutions
- Brute force oracle generation for validation
Capabilities
Core Features
Random Test Generation
- Generate inputs within specified constraints
- Support for various data types (arrays, trees, graphs, strings)
- Configurable distributions (uniform, normal, edge-biased)
- Reproducible tests with seed values
Edge Case Generation
- Minimum/maximum constraint values
- Empty inputs, single elements
- Sorted/reverse sorted sequences
- All same elements, alternating patterns
- Boundary conditions
Stress Testing
- Maximum constraint inputs
- Time limit verification
- Memory limit testing
- Performance regression detection
Counter-Example Finding
- Compare against brute force oracle
- Binary search on input size for minimal failing case
- Automatic test case minimization
- Difference reporting
Data Structure Generation
- Arrays: random, sorted, nearly sorted, with duplicates
- Trees: binary trees, BSTs, balanced, skewed
- Graphs: sparse, dense, DAGs, with cycles
- Strings: random, palindromes, patterns
Integration Options
CLI Tools
QuickTest CLI - Comprehensive CP testing tool:
npm install -g quicktest-cli
# Compare against brute force
qt cmp --solution solution.cpp --brute brute.cpp --gen gen.cpp
# Stress test for TLE
qt stress --solution solution.cpp --gen gen.cpp --time-limit 1000
Stress Testing Script (7oSkaaa):
git clone https://github.com/7oSkaaa/Stress_Testing
# Provides: gen_array(), gen_tree(), gen_simple_graph()
testlib.h (Codeforces Standard)
#include "testlib.h"
int main(int argc, char* argv[]) {
registerGen(argc, argv, 1);
int n = opt<int>("n", rnd.next(1, 100000));
println(n);
println(rnd.any(range(n), [](int) {
return rnd.next(-1000000000, 1000000000);
}));
return 0;
}
Usage
Generate Random Test Cases
# Generate array test cases
test-case-generator array \
--min-size 1 \
--max-size 100000 \
--min-value -1e9 \
--max-value 1e9 \
--count 100
# Generate graph test cases
test-case-generator graph \
--nodes 1000 \
--edges 5000 \
--type undirected \
--connected true
Generate Edge Cases
# Automatic edge case generation
test-case-generator edge-cases --problem "two-sum" --constraints constraints.json
# Output includes:
# - Empty array []
# - Single element [x]
# - Two elements (match/no-match)
# - All same elements
# - Maximum array size
# - Maximum/minimum values
Stress Testing
# Compare solution against brute force
test-case-generator stress \
--solution solution.cpp \
--brute brute.cpp \
--iterations 1000 \
--timeout 5000
# Output on failure:
# Found counter-example at iteration 47:
# Input: [3, 5, 2, 8, 1]
# Target: 6
# Expected: [0, 2]
# Actual: [1, 2]
Find Minimal Counter-Example
# Binary search for smallest failing input
test-case-generator minimize \
--solution solution.cpp \
--brute brute.cpp \
--failing-input large_input.txt
# Output:
# Original input size: 10000
# Minimal failing input size: 4
# Minimal input: [3, 1, 2, 4]
Output Schema
{
"testCases": [
{
"id": "test_001",
"category": "edge_case",
"description": "Empty array",
"input": {
"arr": [],
"target": 5
},
"expectedOutput": [],
"tags": ["empty", "boundary"]
},
{
"id": "test_002",
"category": "random",
"description": "Random array, n=1000",
"input": {
"arr": [...],
"target": 12345
},
"expectedOutput": null,
"oracle": "brute_force"
}
],
"metadata": {
"generatedAt": "ISO8601",
"seed": 42,
"constraints": {
"n": [1, 100000],
"values": [-1e9, 1e9]
}
}
}
Generator Templates
Array Generator
def generate_array(n_range=(1, 100000), value_range=(-1e9, 1e9), seed=None):
"""Generate random array within constraints."""
if seed:
random.seed(seed)
n = random.randint(*n_range)
return [random.randint(*value_range) for _ in range(n)]
def generate_edge_cases():
"""Generate common edge cases for array problems."""
return [
[], # Empty
[0], # Single element
[1, 1], # Two same
[1, 2], # Two different
list(range(100)), # Sorted ascending
Установить test-case-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadWriteGrepGlobВложенные файлы
FAQ
Что делает скилл test-case-generator?
Generate comprehensive test cases including edge cases, stress tests, and counter-examples for algorithm correctness verification. Supports random generation, constraint-based generation, and brute force oracle comparison.
Как установить скилл test-case-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-case-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic