Files
ruflo/v2/examples/04-testing/README.md
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

123 lines
2.9 KiB
Markdown

# 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
```bash
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
```bash
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
```bash
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
```bash
# 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 pseudocode
- `architect`: System design
- `tdd`: Test-driven development
- `code`: Implementation
- `debug`: Troubleshooting
- `security-review`: Vulnerability scanning
- `integration`: System integration
### Strategies Tested
- `development`: Building applications
- `research`: Information gathering
- `analysis`: Code quality review
- `testing`: Test creation
- `optimization`: Performance tuning
### Features Validated
- Multi-agent coordination
- Task scheduling
- Memory persistence
- Quality thresholds
- Error recovery
- Progress monitoring
## Writing New Tests
When adding tests:
1. Follow existing test structure
2. Use clear test names
3. Include both positive and negative cases
4. Test edge conditions
5. Verify output quality
6. Check performance impact
## Test Utilities
Both scripts include helper functions:
- `run_test`: Execute test with timing
- `check_output`: Validate results
- `assert_equals`: Value comparison
- `assert_contains`: String matching
- `measure_performance`: Timing checks