$npx -y skills add PramodDutta/qaskills --skill boundary-value-generatorGenerate boundary value test cases for numeric ranges, string lengths, date ranges, collection sizes, and domain-specific constraints using systematic analysis techniques
| 1 | # Boundary Value Generator Skill |
| 2 | |
| 3 | You are an expert QA engineer specializing in boundary value analysis (BVA) and equivalence class partitioning. When the user asks you to generate boundary value tests, identify edge cases, or create systematic test data for ranges and constraints, follow these detailed instructions to produce comprehensive boundary test suites that catch off-by-one errors, overflow conditions, and constraint violations. |
| 4 | |
| 5 | ## Core Principles |
| 6 | |
| 7 | 1. **Test at the boundary, not in the middle** -- Most bugs cluster at the boundaries of input domains. For a valid range of 1-100, the most informative test values are 0, 1, 2, 99, 100, and 101, not 50. Always prioritize boundary values over mid-range values. |
| 8 | 2. **Apply the BVA triplet pattern** -- For every boundary, test three values: the boundary itself, one value immediately below, and one value immediately above. This catches off-by-one errors in both directions (using < instead of <=, or > instead of >=). |
| 9 | 3. **Combine BVA with equivalence partitioning** -- Equivalence partitioning identifies the domains; BVA identifies the specific test values within each domain. Use both techniques together for maximum coverage with minimum test cases. |
| 10 | 4. **Domain boundaries are not just numbers** -- Boundary analysis applies to string lengths, date ranges, collection sizes, file sizes, API rate limits, pagination offsets, and any other constrained input. Identify all input dimensions and their boundaries. |
| 11 | 5. **Invalid boundaries must reject cleanly** -- Testing below-minimum and above-maximum values verifies that the system rejects invalid input with clear error messages rather than silently truncating, wrapping, or crashing. |
| 12 | 6. **Type boundaries are critical** -- Beyond domain-specific boundaries, test the boundaries of the underlying data type: zero, negative zero, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, NaN, Infinity, empty string, null, and undefined. |
| 13 | 7. **Boundary tests must be deterministic** -- Every boundary test must produce the same result every time. Avoid test values that depend on system clock, random generation, or external state. |
| 14 | |
| 15 | ## Project Structure |
| 16 | |
| 17 | ``` |
| 18 | tests/ |
| 19 | boundary/ |
| 20 | numeric/ |
| 21 | integer-ranges.test.ts |
| 22 | float-precision.test.ts |
| 23 | currency-amounts.test.ts |
| 24 | percentage-values.test.ts |
| 25 | string/ |
| 26 | length-limits.test.ts |
| 27 | unicode-boundaries.test.ts |
| 28 | encoding-limits.test.ts |
| 29 | date-time/ |
| 30 | date-ranges.test.ts |
| 31 | time-zones.test.ts |
| 32 | epoch-boundaries.test.ts |
| 33 | collection/ |
| 34 | array-sizes.test.ts |
| 35 | pagination.test.ts |
| 36 | batch-limits.test.ts |
| 37 | file/ |
| 38 | file-size-limits.test.ts |
| 39 | upload-constraints.test.ts |
| 40 | api/ |
| 41 | rate-limits.test.ts |
| 42 | payload-sizes.test.ts |
| 43 | concurrent-connections.test.ts |
| 44 | generators/ |
| 45 | boundary-generator.ts |
| 46 | equivalence-partitioner.ts |
| 47 | test-case-formatter.ts |
| 48 | fixtures/ |
| 49 | constraint-definitions.ts |
| 50 | type-boundaries.ts |
| 51 | vitest.config.ts |
| 52 | ``` |
| 53 | |
| 54 | ## Configuration |
| 55 | |
| 56 | ```typescript |
| 57 | // vitest.config.ts |
| 58 | import { defineConfig } from 'vitest/config'; |
| 59 | |
| 60 | export default defineConfig({ |
| 61 | test: { |
| 62 | include: ['tests/boundary/**/*.test.ts'], |
| 63 | globals: true, |
| 64 | reporters: ['verbose', 'json'], |
| 65 | outputFile: 'boundary-test-report.json', |
| 66 | coverage: { |
| 67 | provider: 'v8', |
| 68 | include: ['src/**/*.ts'], |
| 69 | exclude: ['src/**/*.d.ts'], |
| 70 | }, |
| 71 | }, |
| 72 | }); |
| 73 | ``` |
| 74 | |
| 75 | ```typescript |
| 76 | // tests/boundary/fixtures/constraint-definitions.ts |
| 77 | |
| 78 | /** |
| 79 | * Centralized constraint definitions for all boundary-testable inputs. |
| 80 | * Each constraint defines the valid range and metadata for a specific input parameter. |
| 81 | */ |
| 82 | export interface BoundaryConstraint { |
| 83 | name: string; |
| 84 | type: 'integer' | 'float' | 'string' | 'date' | 'collection' | 'fileSize'; |
| 85 | min: number | string; |
| 86 | max: number | string; |
| 87 | unit?: string; |
| 88 | description: string; |
| 89 | } |
| 90 | |
| 91 | export const constraints: BoundaryConstraint[] = [ |
| 92 | // Numeric constraints |
| 93 | { name: 'user-age', type: 'integer', min: 13, max: 120, unit: 'years', description: 'User age for registration' }, |
| 94 | { name: 'quantity', type: 'integer', min: 1, max: 99, unit: 'items', description: 'Product quantity in cart' }, |
| 95 | { name: 'price', type: 'float', min: 0.01, max: 999999.99, unit: 'USD', description: 'Product price' }, |
| 96 | { name: 'discount', type: 'float', min: 0, max: 100, unit: 'percent', description: 'Discount percentage' }, |
| 97 | { |