Summary
The codebase currently has no unit tests for the src/ folder. Test coverage analysis shows:
0 test files in src/
154 untested source files
0% test coverage
Scope
Priority 1: Core Services (High Value)
Services with complex logic that would benefit most from testing:
Priority 2: MCP Handlers (21 handlers)
Analysis handlers (7): architecture, ci-pipeline, code-quality, documentation, impact-analysis, performance-analysis, test-coverage
Project handlers (7): constitution, danger-zone, dependency, environment, onboard, release, resource
Workflow handlers (4): execution, planning, spec, status
Other handlers (3): checkpoint, memory, security, team-knowledge, pr-review
Priority 3: Infrastructure
Suggested Approach
Setup : Configure Vitest (faster than Jest, native ESM support)
Test Structure : Mirror src/ structure in tests/
Mocking : Use dependency injection for testable services
Coverage Target : Start with 60%, aim for 80%
Test Framework Setup
npm install -D vitest @vitest/coverage-v8
// vitest.config.ts
export default {
test : {
globals : true ,
environment : 'node' ,
coverage : {
provider : 'v8' ,
reporter : [ 'text' , 'html' ] ,
include : [ 'src/**/*.ts' ] ,
exclude : [ 'src/**/*.d.ts' ]
}
}
}
Example Test Structure
tests/
├── core/
│ └── mcp/
│ ├── services/
│ │ ├── code-quality-service.test.ts
│ │ ├── security-service.test.ts
│ │ └── architecture-service.test.ts
│ ├── handlers/
│ │ └── analysis/
│ │ └── code-quality-handler.test.ts
│ └── registry/
│ └── tool-registry.test.ts
Acceptance Criteria
References
Test coverage analysis tool: test-coverage-analyze
Current untested files: 154
Summary
The codebase currently has no unit tests for the
src/folder. Test coverage analysis shows:Scope
Priority 1: Core Services (High Value)
Services with complex logic that would benefit most from testing:
code-quality-service.ts- Complexity analysis, scoring algorithmsecurity-service.ts- Pattern matching, vulnerability detectionarchitecture-service.ts- Glob pattern matching, validation rulesdocumentation-service.ts- JSDoc parsing, coverage calculationperformance-analyzer.ts- Anti-pattern detectiontest-coverage/- Test parsing, smell detectionPriority 2: MCP Handlers (21 handlers)
Priority 3: Infrastructure
registry/tool-registry.ts- Tool discovery, schema generationdecorators/- @mcptool, @MCPParam decoratorsserver.ts- MCP server initializationSuggested Approach
Test Framework Setup
Example Test Structure
Acceptance Criteria
npm testcommand worksReferences
test-coverage-analyze