task-master-neo-sdlc
Version:
Enhanced task management system with Neo SDLC agents and MCP tools for comprehensive, AI-driven software development lifecycle management.
214 lines (156 loc) • 5.04 kB
Markdown
# QA Agent and TDD Framework
This directory contains the QA Agent and TDD Framework for the Neo System, which provides comprehensive testing capabilities for software development projects.
## Overview
The QA Agent and TDD Framework provide the following features:
- **Multiple Test Frameworks**: Support for Jest, Vitest, Mocha, Cypress, Playwright, and more
- **AI-Powered Test Generation**: Uses AI to generate sophisticated test cases and code
- **TDD Workflow**: Implements the Test-Driven Development workflow with maker-checker pattern
- **CI/CD Integration**: Connects with CI/CD systems for automated testing
- **Test Metrics and Reporting**: Collects, analyzes, and reports test metrics
## Components
### QA Agent
The QA Agent is a specialized agent that focuses on testing and quality assurance. It can:
- Create tests for components and modules
- Validate implementations against tests
- Generate refactoring suggestions
- Collect and analyze test metrics
### TDD Framework
The TDD Framework coordinates the Test-Driven Development workflow between developer agents and QA agents. It manages:
- TDD workflow creation and execution
- Step dependencies and sequencing
- Test generation, implementation, validation, and refactoring
### Test Frameworks
The system supports multiple test frameworks, including:
- **Jest**: For unit and integration testing
- **Vitest**: For unit and integration testing with Vite
- **Mocha**: For unit and integration testing
- **Cypress**: For end-to-end testing
- **Playwright**: For end-to-end and visual testing
- **Puppeteer**: For end-to-end and performance testing
- **Supertest**: For API testing
- **Storybook**: For visual and component testing
### AI Test Generation
The system uses AI to generate sophisticated test cases and code based on:
- Component/module analysis
- Acceptance criteria
- Implementation details
- Test framework best practices
### CI/CD Integration
The system integrates with CI/CD systems, including:
- GitHub Actions
- GitLab CI
- Jenkins
- CircleCI
- Travis CI
### Test Metrics and Reporting
The system collects, analyzes, and reports test metrics, including:
- Coverage metrics (statements, branches, functions, lines)
- Performance metrics (execution time, memory usage)
- Reliability metrics (failure rate, uptime)
- Maintainability metrics (complexity, duplication)
## Usage
### Creating a QA Agent
```javascript
import { QAAgent } from '../agents/qa-agent.js';
// Create a QA agent
const qaAgent = new QAAgent('qa-1', {
capabilities: ['testing', 'quality-assurance', 'tdd'],
knowledgeDomains: ['jest', 'testing-library', 'react-testing'],
preferredFramework: 'jest',
coverageThreshold: 80,
useAI: true,
cicdIntegration: true,
collectMetrics: true
});
```
### Creating a TDD Workflow
```javascript
import { TDDFramework } from '../tdd-framework.js';
// Create a TDD workflow
const workflow = await tddFramework.createTDDWorkflow({
id: 'tdd-workflow-1',
taskMasterId: '1',
makerAgentId: 'dev-1',
checkerAgentId: 'qa-1',
testConfig: {
framework: 'jest',
coverage: 80,
testTypes: ['unit', 'integration'],
useAI: true,
setupCICD: true,
collectMetrics: true
}
});
```
### Executing a TDD Workflow
```javascript
// Execute a TDD workflow
const result = await tddFramework.executeTDDWorkflow('tdd-workflow-1');
// Check the result
if (result.success) {
console.log('TDD workflow completed successfully');
} else {
console.log('TDD workflow failed');
}
```
## Configuration
### Test Framework Configuration
The system automatically detects and recommends test frameworks based on the project type and features. You can also specify a preferred framework:
```javascript
const qaAgent = new QAAgent('qa-1', {
preferredFramework: 'jest'
});
```
### Test Types Configuration
You can specify the types of tests to create:
```javascript
const workflow = await tddFramework.createTDDWorkflow({
testConfig: {
testTypes: ['unit', 'integration', 'e2e']
}
});
```
### Coverage Configuration
You can specify the coverage threshold:
```javascript
const workflow = await tddFramework.createTDDWorkflow({
testConfig: {
coverage: 80
}
});
```
### AI Configuration
You can enable or disable AI-powered test generation:
```javascript
const qaAgent = new QAAgent('qa-1', {
useAI: true
});
```
### CI/CD Configuration
You can enable or disable CI/CD integration:
```javascript
const workflow = await tddFramework.createTDDWorkflow({
testConfig: {
setupCICD: true
}
});
```
### Metrics Configuration
You can enable or disable metrics collection:
```javascript
const workflow = await tddFramework.createTDDWorkflow({
testConfig: {
collectMetrics: true
}
});
```
## Testing
The system includes comprehensive tests for the QA Agent and TDD Framework:
```bash
# Run all tests
npm test
# Run QA Agent tests
npm test -- src/core/neo/agents/__tests__/qa-agent.test.js
# Run TDD Framework tests
npm test -- src/core/neo/__tests__/tdd-framework.test.js
```