Labsco
fyuuki0jp logo

Test Code Generator

โ˜… 2

from fyuuki0jp

Generates Vitest test code from JSON specifications using boundary value analysis and equivalence partitioning.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Test Code Generator MCP Server

An MCP server that generates Vitest test code based on boundary value analysis and equivalence partitioning from JSON specifications.

Features

  • Boundary Value Analysis: Automatically generates boundary values and their adjacent values for continuous ranges
  • Multiple Range Support: Handles discontinuous valid ranges (e.g., 0-10, 20-30, 40-50)
  • Equivalence Partitioning: Includes all valid and invalid values from categorical data
  • Pairwise Testing: Generates efficient test combinations using pairwise method
  • Vitest Format: Generates clean test code using test.each pattern
  • Specification Guide: Provides prompts to help create JSON specifications
  • Language-Optimized: All processing and output in English for optimal LLM performance

Key Features

Full Coverage

  • All valid and invalid equivalence class values are included in test cases
  • Boundary values include: min-1, min, min+1, middle, max-1, max, max+1
  • For multiple ranges, includes gap values between ranges

Efficient Combinations

  • 3 or fewer parameters: generates all combinations
  • 4 or more parameters: uses pairwise method for efficiency

Multiple Range Support

Useful for:

  • Working hours (9-12, 14-18)
  • Valid scores (0-40 passing, 60-100 honors)
  • Temperature ranges (different valid ranges for different conditions)
  • Time slots (morning, afternoon, evening sessions)

Examples

See the examples/ directory for more specification examples:

  • user-registration.json - Basic model validation
  • calculate-discount.json - Business logic with multiple parameters
  • multi-range-validation.json - Complex scheduling with multiple ranges
  • japanese-postal-code.json - Regional validation patterns

Development

# Development mode
npm run dev

# Build
npm run build

# Production mode
npm start

# Debug mode
DEBUG=1 npm start

Publishing to npm

# Build and publish
npm publish

Support