mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 05:35:21 +09:00
Testing Examples
Scripts for testing Claude Flow functionality and validating system features.
Directory Structure
04-testing/
├── unit/ # Unit tests for individual components
├── integration/ # Integration tests for workflows
├── performance/ # Performance benchmarks
├── sparc/ # SPARC-specific tests
├── sparc-swarm-test.sh # Original SPARC test suite
└── test-swarm-cli.sh # Original CLI tests
Test Categories
Unit Tests (unit/)
- test-memory-system.sh: Complete memory system unit tests
- Store, query, update, delete operations
- Bulk operations and stats
- Export/import functionality
cd examples/04-testing/unit ./test-memory-system.sh
Integration Tests (integration/)
- test-workflow-execution.sh: End-to-end workflow testing
- Workflow execution verification
- Output validation
- Error handling
- Resource cleanup
cd examples/04-testing/integration ./test-workflow-execution.sh
Performance Tests (performance/)
- benchmark-swarm.sh: Performance benchmarking suite
- Execution time measurements
- Resource usage analysis
- Performance recommendations
cd examples/04-testing/performance ./benchmark-swarm.sh
Original Test Files
sparc-swarm-test.sh
Comprehensive SPARC TDD test suite (235 lines)
- Tests all SPARC modes
- Validates TDD workflow
- Memory integration tests
test-swarm-cli.sh
CLI functionality tests (129 lines)
- Command validation
- Strategy testing
- Error handling
Running Tests
# Run full SPARC test suite
./sparc-swarm-test.sh
# Run CLI tests
./test-swarm-cli.sh
# Verbose mode for debugging
./sparc-swarm-test.sh --verbose
# Test specific strategy
./test-swarm-cli.sh --strategy development
Test Coverage
SPARC Modes Tested
spec-pseudocode: Requirements and pseudocodearchitect: System designtdd: Test-driven developmentcode: Implementationdebug: Troubleshootingsecurity-review: Vulnerability scanningintegration: System integration
Strategies Tested
development: Building applicationsresearch: Information gatheringanalysis: Code quality reviewtesting: Test creationoptimization: Performance tuning
Features Validated
- Multi-agent coordination
- Task scheduling
- Memory persistence
- Quality thresholds
- Error recovery
- Progress monitoring
Writing New Tests
When adding tests:
- Follow existing test structure
- Use clear test names
- Include both positive and negative cases
- Test edge conditions
- Verify output quality
- Check performance impact
Test Utilities
Both scripts include helper functions:
run_test: Execute test with timingcheck_output: Validate resultsassert_equals: Value comparisonassert_contains: String matchingmeasure_performance: Timing checks