Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/a5c-ai-test-case-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 159% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 196% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 130% | 0% |
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.
Generate test cases for:
QuickTest CLI - Comprehensive CP testing tool:
bashnpm 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):
bashgit clone https://github.com/7oSkaaa/Stress_Testing # Provides: gen_array(), gen_tree(), gen_simple_graph()
cpp#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; }
bash# 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
bash# 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
bash# 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]
bash# 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]
json{ "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] } } }
pythondef 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 list(range(100, 0, -1)), # Sorted descending [5] * 100, # All same [10**9] * 1000, # Max values [-10**9] * 1000, # Min values ]
pythondef generate_tree(n, tree_type='random'): """Generate tree with n nodes.""" if tree_type == 'random': return random_tree(n) elif tree_type == 'line': return [(i, i+1) for i in range(1, n)] elif tree_type == 'star': return [(1, i) for i in range(2, n+1)] elif tree_type == 'binary': return [(i, 2*i), (i, 2*i+1) for i in range(1, n//2+1)]
pythondef generate_graph(n, m, graph_type='undirected', connected=True): """Generate graph with n nodes and m edges.""" edges = set() # Ensure connectivity with spanning tree if connected: nodes = list(range(1, n+1)) random.shuffle(nodes) for i in range(1, n): u = nodes[random.randint(0, i-1)] v = nodes[i] edges.add((min(u,v), max(u,v))) # Add remaining edges while len(edges) < m: u, v = random.randint(1, n), random.randint(1, n) if u != v and (min(u,v), max(u,v)) not in edges: edges.add((min(u,v), max(u,v))) return list(edges)
1. Write solution.cpp (your solution)
2. Write brute.cpp (naive but correct)
3. Write gen.cpp (test generator)
4. Run stress test loop:
- Generate input with gen.cpp
- Run both solutions
- Compare outputs
- If different, report counter-example
5. If counter-example found:
- Minimize input
- Debug solution
- Repeat| Category | Examples | |----------|----------| | Empty | ], "", null | | Single | x], "a", single node | | Boundary | n=1, n=max, value=min/max | | Duplicates | All same, many duplicates | | Sorted | Ascending, descending, nearly sorted | | Extremes | INT_MAX, INT_MIN, 0 | | Special | Palindrome, balanced, skewed |
This skill enhances:
correctness-proof-testing - Verify algorithm correctnessalgorithm-implementation - Test during developmentleetcode-problem-solving - Additional test coverageupsolving - Debug failed solutions| Error | Cause | Resolution | |-------|-------|------------| | CONSTRAINT_VIOLATION | Generated value out of range | Check constraint bounds | | TIMEOUT | Generation taking too long | Reduce size or simplify | | MEMORY_EXCEEDED | Too many test cases in memory | Stream to file | | ORACLE_FAILED | Brute force solution crashed | Debug brute force |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 13,545 | 10,867 | -20% | 1 | 1 | 0% | 2,755 | 4,884 | +77% | 0 | 0 | — |
case-02 | fail→pass | 17,294 | 6,334 | -63% | 1 | 1 | 0% | 2,817 | 3,870 | +37% | 0 | 0 | — |
case-03 | fail→pass | 16,042 | 4,157 | -74% | 1 | 1 | 0% | 2,401 | 3,361 | +40% | 0 | 0 | — |
case-04 | fail→pass | 22,226 | 6,554 | -71% | 1 | 1 | 0% | 1,483 | 3,835 | +159% | 0 | 0 | — |
case-05 | fail→fail | 12,773 | 3,944 | -69% | 1 | 1 | 0% | 2,443 | 3,425 | +40% | 0 | 0 | — |
case-06 | fail→pass | 6,177 | 4,573 | -26% | 1 | 1 | 0% | 1,157 | 3,421 | +196% | 0 | 0 | — |
case-07 | fail→pass | 8,955 | 6,131 | -32% | 1 | 1 | 0% | 1,637 | 3,761 | +130% | 0 | 0 | — |
case-08 | pass→pass | 3,707 | 4,560 | +23% | 1 | 1 | 0% | 656 | 3,295 | +402% | 0 | 0 | — |
case-09 | fail→pass | 9,505 | 4,991 | -47% | 1 | 1 | 0% | 1,822 | 3,502 | +92% | 0 | 0 | — |
case-10 | fail→pass | 10,113 | 1,906 | -81% | 1 | 1 | 0% | 1,866 | 2,932 | +57% | 0 | 0 | — |
case-11 | fail→pass | 16,196 | 14,394 | -11% | 1 | 1 | 0% | 3,020 | 5,106 | +69% | 0 | 0 | — |
case-12 | pass→pass | 16,633 | 14,796 | -11% | 1 | 1 | 0% | 3,038 | 5,352 | +76% | 0 | 0 | — |
case-13 | pass→pass | 14,904 | 10,744 | -28% | 1 | 1 | 0% | 2,806 | 4,815 | +72% | 0 | 0 | — |
case-14 | fail→pass | 15,855 | 18,551 | +17% | 1 | 1 | 0% | 2,853 | 5,984 | +110% | 0 | 0 | — |
case-15 | pass→pass | 12,989 | 7,176 | -45% | 1 | 1 | 0% | 2,449 | 3,935 | +61% | 0 | 0 | — |
case-16 | pass→pass | 11,749 | 14,044 | +20% | 1 | 1 | 0% | 1,961 | 5,171 | +164% | 0 | 0 | — |
case-17 | pass→pass | 11,987 | 6,284 | -48% | 1 | 1 | 0% | 2,120 | 3,646 | +72% | 0 | 0 | — |
case-18 | pass→pass | 9,588 | 5,475 | -43% | 1 | 1 | 0% | 1,695 | 3,557 | +110% | 0 | 0 | — |
case-19 | pass→pass | 11,047 | 11,524 | +4% | 1 | 1 | 0% | 1,873 | 4,474 | +139% | 0 | 0 | — |
case-20 | pass→pass | 6,783 | 6,599 | -3% | 1 | 1 | 0% | 1,122 | 3,544 | +216% | 0 | 0 | — |
case-21 | pass→pass | 6,865 | 7,839 | +14% | 1 | 1 | 0% | 1,500 | 4,093 | +173% | 0 | 0 | — |
case-22 | fail→fail | 7,726 | 5,286 | -32% | 1 | 1 | 0% | 1,400 | 3,499 | +150% | 0 | 0 | — |
case-23 | pass→pass | 12,155 | 11,468 | -6% | 1 | 1 | 0% | 2,686 | 5,234 | +95% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +39 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.