generate-stress-test
Generate stress test inputs to evaluate grammar performance and robustness using nested, wide, or repetition strategies. Identify bottlenecks and benchmark behavior under extreme input patterns.
Instructions
Generate stress test inputs for grammar performance testing.
When to use: Testing grammar robustness, identifying performance issues, benchmarking.
Generation strategies:
nested: Deep nesting of recursive rules (tests stack depth)
wide: Many alternatives in choice rules (tests branching)
repetition: Repeated sequences (tests loops)
mixed: Combination of all strategies (default)
Parameters:
grammar_content: The grammar to generate tests for
strategy: Generation strategy (nested, wide, repetition, mixed)
depth: Nesting depth for nested strategy (default: 50)
count: Number of alternatives for wide strategy (default: 100)
repetitions: Repetition count for repetition strategy (default: 100)
Returns:
Generated test input
Expected characteristics (depth, width, size)
Warnings if grammar structure can't support requested strategy
Example: grammar_content: "grammar Expr; ..." strategy: "nested" depth: 30
Output: "(((...(1 + 2)...)))" (30 levels deep)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of alternatives for wide strategy (default: 100) | |
| depth | No | Nesting depth for nested strategy (default: 50) | |
| strategy | No | Generation strategy (default: mixed) | |
| from_file | No | Optional: path to a grammar file to read | |
| repetitions | No | Repetition count for repetition strategy (default: 100) | |
| grammar_content | No | The ANTLR4 grammar file content |