/** * Auto-generated test scenario generation from schema analysis. * * This module analyzes tool schemas and generates comprehensive test scenarios * covering happy paths, edge cases, error handling, and security testing. */ import type { ToolFingerprint, BehavioralBaseline } from './types.js'; /** * Category of test scenario. */ export type ScenarioCategory = 'happy_path' | 'edge_cases' | 'error_handling' | 'security'; /** * Priority level for test scenarios. */ export type ScenarioPriority = 'critical' | 'high' | 'medium' | 'low'; /** * A single test scenario for a tool. */ export interface TestScenario { /** Unique identifier for the scenario */ id: string; /** Name of the tool this scenario tests */ toolName: string; /** Category of test scenario */ category: ScenarioCategory; /** Human-readable description of what is being tested */ description: string; /** The input to provide to the tool */ input: Record; /** Expected behavior or assertion */ expectedBehavior: string; /** Priority level for execution order */ priority: ScenarioPriority; /** Tags for filtering/grouping */ tags: string[]; /** Why this scenario was generated */ rationale: string; /** Parameter(s) being tested */ targetParameter?: string; } /** * Collection of auto-generated test scenarios for a tool. */ export interface AutoGeneratedScenarios { /** Tool being tested */ toolName: string; /** Tool description for context */ toolDescription: string; /** Success/valid input scenarios */ happyPath: TestScenario[]; /** Boundary conditions and unusual inputs */ edgeCases: TestScenario[]; /** Invalid input and error scenarios */ errorCases: TestScenario[]; /** Security-focused test cases */ securityTests: TestScenario[]; /** Total coverage percentage estimate */ coverageEstimate: number; /** Parameters with generated scenarios */ coveredParameters: string[]; /** Parameters without scenarios (may need manual tests) */ uncoveredParameters: string[]; /** When scenarios were generated */ generatedAt: Date; } /** * Summary of generated scenarios for an entire baseline. */ export interface ScenarioGenerationSummary { /** Total tools processed */ toolsProcessed: number; /** Tools that got scenarios generated */ toolsWithScenarios: number; /** Tools skipped (no schema, etc.) */ toolsSkipped: number; /** Total scenarios generated */ totalScenarios: number; /** Breakdown by category */ scenariosByCategory: Record; /** Breakdown by priority */ scenariosByPriority: Record; /** Average coverage estimate across tools */ averageCoverage: number; /** Tools with low coverage that need attention */ lowCoverageTools: string[]; /** Generated timestamp */ generatedAt: Date; } /** * Result of scenario generation for a baseline. */ export interface ScenarioGenerationResult { /** Per-tool scenario collections */ scenarios: AutoGeneratedScenarios[]; /** Overall summary */ summary: ScenarioGenerationSummary; } /** * Configuration for scenario generation. */ export interface ScenarioGenerationConfig { /** Maximum happy path scenarios per tool */ maxHappyPath?: number; /** Maximum edge case scenarios per tool */ maxEdgeCases?: number; /** Maximum error case scenarios per tool */ maxErrorCases?: number; /** Maximum security scenarios per tool */ maxSecurityScenarios?: number; /** Minimum coverage to aim for */ minCoverage?: number; /** Categories to generate (defaults to all) */ categories?: ScenarioCategory[]; /** Specific tools to generate for (defaults to all) */ tools?: string[]; /** Include security payloads for injection testing */ includeSecurityPayloads?: boolean; } /** * Generate test scenarios for a single tool. */ export declare function generateToolScenarios(tool: ToolFingerprint, config?: ScenarioGenerationConfig): AutoGeneratedScenarios; /** * Generate test scenarios for all tools in a baseline. */ export declare function generateBaselineScenarios(baseline: BehavioralBaseline, config?: ScenarioGenerationConfig): ScenarioGenerationResult; /** * Format scenarios as YAML for test execution. */ export declare function formatScenariosAsYaml(result: ScenarioGenerationResult): string; /** * Format scenarios as a human-readable report. */ export declare function formatScenariosReport(result: ScenarioGenerationResult): string; /** * Get scenarios filtered by priority. */ export declare function getScenariosByPriority(result: ScenarioGenerationResult, priority: ScenarioPriority): TestScenario[]; /** * Get scenarios filtered by category. */ export declare function getScenariosByCategory(result: ScenarioGenerationResult, category: ScenarioCategory): TestScenario[]; /** * Get critical scenarios for smoke testing. */ export declare function getCriticalScenarios(result: ScenarioGenerationResult): TestScenario[]; /** * Get security-focused scenarios. */ export declare function getSecurityScenarios(result: ScenarioGenerationResult): TestScenario[]; //# sourceMappingURL=scenario-generator.d.ts.map