agentic-qe 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/qe-coverage-analyzer.md +8 -0
- package/.claude/agents/qe-flaky-test-hunter.md +9 -1
- package/.claude/agents/qe-test-generator.md +7 -0
- package/.claude/agents/reasoning/agent.md +816 -0
- package/.claude/agents/reasoning/goal-planner.md +73 -0
- package/.claude/settings.json +64 -25
- package/.claude/skills/README.md +124 -0
- package/.claude/skills/accessibility-testing/SKILL.md +777 -0
- package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
- package/.claude/skills/agentdb-learning/SKILL.md +545 -0
- package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
- package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
- package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
- package/.claude/skills/agentic-quality-engineering/SKILL.md +604 -0
- package/.claude/skills/api-testing-patterns/SKILL.md +686 -0
- package/.claude/skills/bug-reporting-excellence/SKILL.md +632 -0
- package/.claude/skills/chaos-engineering-resilience/SKILL.md +109 -0
- package/.claude/skills/code-review-quality/SKILL.md +683 -0
- package/.claude/skills/compatibility-testing/SKILL.md +101 -0
- package/.claude/skills/compliance-testing/SKILL.md +162 -0
- package/.claude/skills/consultancy-practices/SKILL.md +540 -0
- package/.claude/skills/context-driven-testing/SKILL.md +466 -0
- package/.claude/skills/contract-testing/SKILL.md +193 -0
- package/.claude/skills/database-testing/SKILL.md +243 -0
- package/.claude/skills/exploratory-testing-advanced/SKILL.md +676 -0
- package/.claude/skills/flow-nexus-neural/SKILL.md +738 -0
- package/.claude/skills/flow-nexus-platform/SKILL.md +1157 -0
- package/.claude/skills/flow-nexus-swarm/SKILL.md +610 -0
- package/.claude/skills/github-code-review/SKILL.md +1140 -0
- package/.claude/skills/github-multi-repo/SKILL.md +874 -0
- package/.claude/skills/github-project-management/SKILL.md +1277 -0
- package/.claude/skills/github-release-management/SKILL.md +1081 -0
- package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
- package/.claude/skills/hive-mind-advanced/SKILL.md +712 -0
- package/.claude/skills/holistic-testing-pact/SKILL.md +225 -0
- package/.claude/skills/hooks-automation/SKILL.md +1201 -0
- package/.claude/skills/localization-testing/SKILL.md +115 -0
- package/.claude/skills/mobile-testing/SKILL.md +548 -0
- package/.claude/skills/mutation-testing/SKILL.md +129 -0
- package/.claude/skills/pair-programming/SKILL.md +1202 -0
- package/.claude/skills/performance-analysis/SKILL.md +563 -0
- package/.claude/skills/performance-testing/SKILL.md +662 -0
- package/.claude/skills/quality-metrics/SKILL.md +592 -0
- package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
- package/.claude/skills/refactoring-patterns/SKILL.md +778 -0
- package/.claude/skills/regression-testing/SKILL.md +1045 -0
- package/.claude/skills/risk-based-testing/SKILL.md +721 -0
- package/.claude/skills/security-testing/SKILL.md +651 -0
- package/.claude/skills/shift-left-testing/SKILL.md +535 -0
- package/.claude/skills/shift-right-testing/SKILL.md +591 -0
- package/.claude/skills/skill-builder/SKILL.md +910 -0
- package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
- package/.claude/skills/stream-chain/SKILL.md +563 -0
- package/.claude/skills/swarm-advanced/SKILL.md +973 -0
- package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
- package/.claude/skills/tdd-london-chicago/SKILL.md +567 -0
- package/.claude/skills/technical-writing/SKILL.md +235 -0
- package/.claude/skills/test-automation-strategy/SKILL.md +842 -0
- package/.claude/skills/test-data-management/SKILL.md +1067 -0
- package/.claude/skills/test-design-techniques/SKILL.md +160 -0
- package/.claude/skills/test-environment-management/SKILL.md +204 -0
- package/.claude/skills/test-reporting-analytics/SKILL.md +143 -0
- package/.claude/skills/verification-quality/SKILL.md +649 -0
- package/.claude/skills/visual-testing-advanced/SKILL.md +148 -0
- package/.claude/skills/xp-practices/SKILL.md +671 -0
- package/.claude/statusline-command.sh +176 -0
- package/CHANGELOG.md +623 -6
- package/README.md +101 -5
- package/config/improvement-loop.config.ts +323 -0
- package/config/neural-agent.config.ts +197 -0
- package/dist/adapters/MemoryStoreAdapter.d.ts +16 -16
- package/dist/adapters/MemoryStoreAdapter.d.ts.map +1 -1
- package/dist/adapters/MemoryStoreAdapter.js +16 -16
- package/dist/adapters/MemoryStoreAdapter.js.map +1 -1
- package/dist/agents/BaseAgent.d.ts +69 -0
- package/dist/agents/BaseAgent.d.ts.map +1 -1
- package/dist/agents/BaseAgent.js +387 -5
- package/dist/agents/BaseAgent.js.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.d.ts +13 -2
- package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.js +112 -12
- package/dist/agents/CoverageAnalyzerAgent.js.map +1 -1
- package/dist/agents/DeploymentReadinessAgent.d.ts.map +1 -1
- package/dist/agents/DeploymentReadinessAgent.js +13 -13
- package/dist/agents/DeploymentReadinessAgent.js.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.d.ts +28 -0
- package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.js +160 -4
- package/dist/agents/FlakyTestHunterAgent.js.map +1 -1
- package/dist/agents/FleetCommanderAgent.d.ts.map +1 -1
- package/dist/agents/FleetCommanderAgent.js +4 -3
- package/dist/agents/FleetCommanderAgent.js.map +1 -1
- package/dist/agents/LearningAgent.d.ts +14 -5
- package/dist/agents/LearningAgent.d.ts.map +1 -1
- package/dist/agents/LearningAgent.js +36 -16
- package/dist/agents/LearningAgent.js.map +1 -1
- package/dist/agents/NeuralAgentExtension.d.ts +117 -0
- package/dist/agents/NeuralAgentExtension.d.ts.map +1 -0
- package/dist/agents/NeuralAgentExtension.js +288 -0
- package/dist/agents/NeuralAgentExtension.js.map +1 -0
- package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -1
- package/dist/agents/PerformanceTesterAgent.js +11 -9
- package/dist/agents/PerformanceTesterAgent.js.map +1 -1
- package/dist/agents/ProductionIntelligenceAgent.d.ts.map +1 -1
- package/dist/agents/ProductionIntelligenceAgent.js +14 -13
- package/dist/agents/ProductionIntelligenceAgent.js.map +1 -1
- package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/QualityAnalyzerAgent.js +39 -38
- package/dist/agents/QualityAnalyzerAgent.js.map +1 -1
- package/dist/agents/QualityGateAgent.d.ts.map +1 -1
- package/dist/agents/QualityGateAgent.js +7 -6
- package/dist/agents/QualityGateAgent.js.map +1 -1
- package/dist/agents/RegressionRiskAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/RegressionRiskAnalyzerAgent.js +22 -21
- package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -1
- package/dist/agents/RequirementsValidatorAgent.d.ts.map +1 -1
- package/dist/agents/RequirementsValidatorAgent.js +1 -1
- package/dist/agents/RequirementsValidatorAgent.js.map +1 -1
- package/dist/agents/SecurityScannerAgent.d.ts.map +1 -1
- package/dist/agents/SecurityScannerAgent.js +8 -7
- package/dist/agents/SecurityScannerAgent.js.map +1 -1
- package/dist/agents/TestDataArchitectAgent.d.ts.map +1 -1
- package/dist/agents/TestDataArchitectAgent.js +12 -11
- package/dist/agents/TestDataArchitectAgent.js.map +1 -1
- package/dist/agents/TestExecutorAgent.d.ts.map +1 -1
- package/dist/agents/TestExecutorAgent.js +18 -19
- package/dist/agents/TestExecutorAgent.js.map +1 -1
- package/dist/agents/TestGeneratorAgent.d.ts +15 -4
- package/dist/agents/TestGeneratorAgent.d.ts.map +1 -1
- package/dist/agents/TestGeneratorAgent.js +172 -49
- package/dist/agents/TestGeneratorAgent.js.map +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/mixins/NeuralCapableMixin.d.ts +130 -0
- package/dist/agents/mixins/NeuralCapableMixin.d.ts.map +1 -0
- package/dist/agents/mixins/NeuralCapableMixin.js +358 -0
- package/dist/agents/mixins/NeuralCapableMixin.js.map +1 -0
- package/dist/agents/mixins/QUICCapableMixin.d.ts +34 -0
- package/dist/agents/mixins/QUICCapableMixin.d.ts.map +1 -0
- package/dist/agents/mixins/QUICCapableMixin.js +346 -0
- package/dist/agents/mixins/QUICCapableMixin.js.map +1 -0
- package/dist/cli/commands/agent/benchmark.d.ts.map +1 -1
- package/dist/cli/commands/agent/benchmark.js +2 -1
- package/dist/cli/commands/agent/benchmark.js.map +1 -1
- package/dist/cli/commands/agent/index.d.ts +5 -0
- package/dist/cli/commands/agent/index.d.ts.map +1 -1
- package/dist/cli/commands/agent/index.js +11 -6
- package/dist/cli/commands/agent/index.js.map +1 -1
- package/dist/cli/commands/agent/kill.d.ts +13 -0
- package/dist/cli/commands/agent/kill.d.ts.map +1 -0
- package/dist/cli/commands/agent/kill.js +65 -0
- package/dist/cli/commands/agent/kill.js.map +1 -0
- package/dist/cli/commands/agent/list.d.ts +19 -0
- package/dist/cli/commands/agent/list.d.ts.map +1 -0
- package/dist/cli/commands/agent/list.js +92 -0
- package/dist/cli/commands/agent/list.js.map +1 -0
- package/dist/cli/commands/agent/logs.d.ts +14 -0
- package/dist/cli/commands/agent/logs.d.ts.map +1 -0
- package/dist/cli/commands/agent/logs.js +77 -0
- package/dist/cli/commands/agent/logs.js.map +1 -0
- package/dist/cli/commands/agent/metrics.d.ts +21 -0
- package/dist/cli/commands/agent/metrics.d.ts.map +1 -0
- package/dist/cli/commands/agent/metrics.js +87 -0
- package/dist/cli/commands/agent/metrics.js.map +1 -0
- package/dist/cli/commands/agent/spawn.d.ts +28 -0
- package/dist/cli/commands/agent/spawn.d.ts.map +1 -0
- package/dist/cli/commands/agent/spawn.js +84 -0
- package/dist/cli/commands/agent/spawn.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -1
- package/dist/cli/commands/analyze.js +2 -1
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/config/list.d.ts.map +1 -1
- package/dist/cli/commands/config/list.js +2 -1
- package/dist/cli/commands/config/list.js.map +1 -1
- package/dist/cli/commands/config/set.d.ts +7 -0
- package/dist/cli/commands/config/set.d.ts.map +1 -1
- package/dist/cli/commands/config/set.js +35 -4
- package/dist/cli/commands/config/set.js.map +1 -1
- package/dist/cli/commands/fleet/logs.d.ts.map +1 -1
- package/dist/cli/commands/fleet/logs.js +2 -1
- package/dist/cli/commands/fleet/logs.js.map +1 -1
- package/dist/cli/commands/fleet/metrics.d.ts.map +1 -1
- package/dist/cli/commands/fleet/metrics.js +2 -1
- package/dist/cli/commands/fleet/metrics.js.map +1 -1
- package/dist/cli/commands/fleet/monitor.d.ts.map +1 -1
- package/dist/cli/commands/fleet/monitor.js +7 -5
- package/dist/cli/commands/fleet/monitor.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts.map +1 -1
- package/dist/cli/commands/fleet.js +2 -1
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +2 -1
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/improve/index.d.ts.map +1 -1
- package/dist/cli/commands/improve/index.js +12 -11
- package/dist/cli/commands/improve/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +24 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +503 -11
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learn/index.d.ts.map +1 -1
- package/dist/cli/commands/learn/index.js +13 -12
- package/dist/cli/commands/learn/index.js.map +1 -1
- package/dist/cli/commands/monitor/alerts.d.ts.map +1 -1
- package/dist/cli/commands/monitor/alerts.js +2 -1
- package/dist/cli/commands/monitor/alerts.js.map +1 -1
- package/dist/cli/commands/patterns/index.d.ts.map +1 -1
- package/dist/cli/commands/patterns/index.js +20 -19
- package/dist/cli/commands/patterns/index.js.map +1 -1
- package/dist/cli/commands/quality/decision.d.ts.map +1 -1
- package/dist/cli/commands/quality/decision.js +9 -7
- package/dist/cli/commands/quality/decision.js.map +1 -1
- package/dist/cli/commands/quality/gate.d.ts.map +1 -1
- package/dist/cli/commands/quality/gate.js +10 -8
- package/dist/cli/commands/quality/gate.js.map +1 -1
- package/dist/cli/commands/quality/policy.d.ts.map +1 -1
- package/dist/cli/commands/quality/policy.js +10 -8
- package/dist/cli/commands/quality/policy.js.map +1 -1
- package/dist/cli/commands/quality/risk.d.ts.map +1 -1
- package/dist/cli/commands/quality/risk.js +5 -3
- package/dist/cli/commands/quality/risk.js.map +1 -1
- package/dist/cli/commands/quality/validate.d.ts.map +1 -1
- package/dist/cli/commands/quality/validate.js +10 -8
- package/dist/cli/commands/quality/validate.js.map +1 -1
- package/dist/cli/commands/quantization.d.ts +6 -0
- package/dist/cli/commands/quantization.d.ts.map +1 -0
- package/dist/cli/commands/quantization.js +188 -0
- package/dist/cli/commands/quantization.js.map +1 -0
- package/dist/cli/commands/routing/index.d.ts +0 -6
- package/dist/cli/commands/routing/index.d.ts.map +1 -1
- package/dist/cli/commands/routing/index.js +17 -16
- package/dist/cli/commands/routing/index.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +2 -1
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/skills/index.d.ts +51 -0
- package/dist/cli/commands/skills/index.d.ts.map +1 -0
- package/dist/cli/commands/skills/index.js +365 -0
- package/dist/cli/commands/skills/index.js.map +1 -0
- package/dist/cli/commands/test/debug.d.ts.map +1 -1
- package/dist/cli/commands/test/debug.js +2 -1
- package/dist/cli/commands/test/debug.js.map +1 -1
- package/dist/cli/commands/test/mutate.d.ts.map +1 -1
- package/dist/cli/commands/test/mutate.js +2 -1
- package/dist/cli/commands/test/mutate.js.map +1 -1
- package/dist/cli/commands/test/parallel.d.ts.map +1 -1
- package/dist/cli/commands/test/parallel.js +6 -4
- package/dist/cli/commands/test/parallel.js.map +1 -1
- package/dist/cli/commands/test/profile.d.ts.map +1 -1
- package/dist/cli/commands/test/profile.js +3 -2
- package/dist/cli/commands/test/profile.js.map +1 -1
- package/dist/cli/commands/test/queue.d.ts.map +1 -1
- package/dist/cli/commands/test/queue.js +2 -1
- package/dist/cli/commands/test/queue.js.map +1 -1
- package/dist/cli/commands/test/retry.d.ts.map +1 -1
- package/dist/cli/commands/test/retry.js +6 -4
- package/dist/cli/commands/test/retry.js.map +1 -1
- package/dist/cli/commands/test/trace.d.ts.map +1 -1
- package/dist/cli/commands/test/trace.js +2 -1
- package/dist/cli/commands/test/trace.js.map +1 -1
- package/dist/cli/commands/test/watch.d.ts.map +1 -1
- package/dist/cli/commands/test/watch.js +3 -2
- package/dist/cli/commands/test/watch.js.map +1 -1
- package/dist/cli/commands/workflow/cancel.d.ts.map +1 -1
- package/dist/cli/commands/workflow/cancel.js +2 -1
- package/dist/cli/commands/workflow/cancel.js.map +1 -1
- package/dist/cli/index-working.js +9 -8
- package/dist/cli/index-working.js.map +1 -1
- package/dist/cli/index.js +97 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/core/EventBus.d.ts +38 -0
- package/dist/core/EventBus.d.ts.map +1 -1
- package/dist/core/EventBus.js +176 -31
- package/dist/core/EventBus.js.map +1 -1
- package/dist/core/FleetManager.d.ts +35 -1
- package/dist/core/FleetManager.d.ts.map +1 -1
- package/dist/core/FleetManager.js +121 -45
- package/dist/core/FleetManager.js.map +1 -1
- package/dist/core/MemoryManager.d.ts +19 -1
- package/dist/core/MemoryManager.d.ts.map +1 -1
- package/dist/core/MemoryManager.js +25 -1
- package/dist/core/MemoryManager.js.map +1 -1
- package/dist/core/coordination/OODACoordination.d.ts.map +1 -1
- package/dist/core/coordination/OODACoordination.js +2 -1
- package/dist/core/coordination/OODACoordination.js.map +1 -1
- package/dist/core/embeddings/EmbeddingCache.d.ts +134 -0
- package/dist/core/embeddings/EmbeddingCache.d.ts.map +1 -0
- package/dist/core/embeddings/EmbeddingCache.js +239 -0
- package/dist/core/embeddings/EmbeddingCache.js.map +1 -0
- package/dist/core/embeddings/EmbeddingGenerator.d.ts +224 -0
- package/dist/core/embeddings/EmbeddingGenerator.d.ts.map +1 -0
- package/dist/core/embeddings/EmbeddingGenerator.js +459 -0
- package/dist/core/embeddings/EmbeddingGenerator.js.map +1 -0
- package/dist/core/embeddings/index.d.ts +15 -0
- package/dist/core/embeddings/index.d.ts.map +1 -0
- package/dist/core/embeddings/index.js +22 -0
- package/dist/core/embeddings/index.js.map +1 -0
- package/dist/core/memory/AgentDBIntegration.d.ts +35 -0
- package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -0
- package/dist/core/memory/AgentDBIntegration.js +75 -0
- package/dist/core/memory/AgentDBIntegration.js.map +1 -0
- package/dist/core/memory/AgentDBManager.d.ts +200 -0
- package/dist/core/memory/AgentDBManager.d.ts.map +1 -0
- package/dist/core/memory/AgentDBManager.js +246 -0
- package/dist/core/memory/AgentDBManager.js.map +1 -0
- package/dist/core/memory/AgentDBService.d.ts +160 -0
- package/dist/core/memory/AgentDBService.d.ts.map +1 -0
- package/dist/core/memory/AgentDBService.js +450 -0
- package/dist/core/memory/AgentDBService.js.map +1 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts +51 -0
- package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -0
- package/dist/core/memory/RealAgentDBAdapter.js +231 -0
- package/dist/core/memory/RealAgentDBAdapter.js.map +1 -0
- package/dist/core/memory/ReasoningBankAdapter.d.ts +58 -0
- package/dist/core/memory/ReasoningBankAdapter.d.ts.map +1 -0
- package/dist/core/memory/ReasoningBankAdapter.js +77 -0
- package/dist/core/memory/ReasoningBankAdapter.js.map +1 -0
- package/dist/core/memory/SwarmMemoryManager.d.ts +75 -3
- package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
- package/dist/core/memory/SwarmMemoryManager.js +240 -55
- package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
- package/dist/core/memory/index.d.ts +4 -0
- package/dist/core/memory/index.d.ts.map +1 -1
- package/dist/core/memory/index.js +9 -1
- package/dist/core/memory/index.js.map +1 -1
- package/dist/core/neural/NeuralTrainer.d.ts +137 -0
- package/dist/core/neural/NeuralTrainer.d.ts.map +1 -0
- package/dist/core/neural/NeuralTrainer.js +544 -0
- package/dist/core/neural/NeuralTrainer.js.map +1 -0
- package/dist/core/neural/index.d.ts +8 -0
- package/dist/core/neural/index.d.ts.map +1 -0
- package/dist/core/neural/index.js +24 -0
- package/dist/core/neural/index.js.map +1 -0
- package/dist/core/neural/types.d.ts +216 -0
- package/dist/core/neural/types.d.ts.map +1 -0
- package/dist/core/neural/types.js +8 -0
- package/dist/core/neural/types.js.map +1 -0
- package/dist/core/quantization/QuantizationManager.d.ts +83 -0
- package/dist/core/quantization/QuantizationManager.d.ts.map +1 -0
- package/dist/core/quantization/QuantizationManager.js +264 -0
- package/dist/core/quantization/QuantizationManager.js.map +1 -0
- package/dist/core/quantization/index.d.ts +5 -0
- package/dist/core/quantization/index.d.ts.map +1 -0
- package/dist/core/quantization/index.js +9 -0
- package/dist/core/quantization/index.js.map +1 -0
- package/dist/core/security/CertificateValidator.d.ts +130 -0
- package/dist/core/security/CertificateValidator.d.ts.map +1 -0
- package/dist/core/security/CertificateValidator.js +376 -0
- package/dist/core/security/CertificateValidator.js.map +1 -0
- package/dist/core/transport/QUICTransport.d.ts +62 -0
- package/dist/core/transport/QUICTransport.d.ts.map +1 -0
- package/dist/core/transport/QUICTransport.js +381 -0
- package/dist/core/transport/QUICTransport.js.map +1 -0
- package/dist/core/transport/SecureQUICTransport.d.ts +71 -0
- package/dist/core/transport/SecureQUICTransport.d.ts.map +1 -0
- package/dist/core/transport/SecureQUICTransport.js +253 -0
- package/dist/core/transport/SecureQUICTransport.js.map +1 -0
- package/dist/learning/AdvancedFeatureExtractor.d.ts +123 -0
- package/dist/learning/AdvancedFeatureExtractor.d.ts.map +1 -0
- package/dist/learning/AdvancedFeatureExtractor.js +423 -0
- package/dist/learning/AdvancedFeatureExtractor.js.map +1 -0
- package/dist/learning/FlakyPredictionModel.d.ts +11 -1
- package/dist/learning/FlakyPredictionModel.d.ts.map +1 -1
- package/dist/learning/FlakyPredictionModel.js +82 -35
- package/dist/learning/FlakyPredictionModel.js.map +1 -1
- package/dist/learning/FlakyTestDetector.d.ts +9 -0
- package/dist/learning/FlakyTestDetector.d.ts.map +1 -1
- package/dist/learning/FlakyTestDetector.js +28 -6
- package/dist/learning/FlakyTestDetector.js.map +1 -1
- package/dist/learning/ImprovementLoop.d.ts +16 -2
- package/dist/learning/ImprovementLoop.d.ts.map +1 -1
- package/dist/learning/ImprovementLoop.js +67 -8
- package/dist/learning/ImprovementLoop.js.map +1 -1
- package/dist/learning/ImprovementWorker.d.ts +83 -0
- package/dist/learning/ImprovementWorker.d.ts.map +1 -0
- package/dist/learning/ImprovementWorker.js +164 -0
- package/dist/learning/ImprovementWorker.js.map +1 -0
- package/dist/learning/NeuralPatternMatcher.d.ts +184 -0
- package/dist/learning/NeuralPatternMatcher.d.ts.map +1 -0
- package/dist/learning/NeuralPatternMatcher.js +702 -0
- package/dist/learning/NeuralPatternMatcher.js.map +1 -0
- package/dist/learning/NeuralTrainer.d.ts +209 -0
- package/dist/learning/NeuralTrainer.d.ts.map +1 -0
- package/dist/learning/NeuralTrainer.js +478 -0
- package/dist/learning/NeuralTrainer.js.map +1 -0
- package/dist/learning/index.d.ts +13 -7
- package/dist/learning/index.d.ts.map +1 -1
- package/dist/learning/index.js +27 -11
- package/dist/learning/index.js.map +1 -1
- package/dist/learning/types.d.ts +1 -0
- package/dist/learning/types.d.ts.map +1 -1
- package/dist/learning/types.js +16 -0
- package/dist/learning/types.js.map +1 -1
- package/dist/mcp/MCPToolRegistry.d.ts +34 -0
- package/dist/mcp/MCPToolRegistry.d.ts.map +1 -0
- package/dist/mcp/MCPToolRegistry.js +48 -0
- package/dist/mcp/MCPToolRegistry.js.map +1 -0
- package/dist/mcp/handlers/advanced/mutation-test-execute.d.ts +3 -3
- package/dist/mcp/handlers/advanced/mutation-test-execute.d.ts.map +1 -1
- package/dist/mcp/handlers/advanced/mutation-test-execute.js +5 -4
- package/dist/mcp/handlers/advanced/mutation-test-execute.js.map +1 -1
- package/dist/mcp/handlers/agent-spawn.d.ts.map +1 -1
- package/dist/mcp/handlers/agent-spawn.js +2 -1
- package/dist/mcp/handlers/agent-spawn.js.map +1 -1
- package/dist/mcp/handlers/analysis/coverageAnalyzeSublinear.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/coverageAnalyzeSublinear.js +9 -8
- package/dist/mcp/handlers/analysis/coverageAnalyzeSublinear.js.map +1 -1
- package/dist/mcp/handlers/analysis/coverageGapsDetect.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/coverageGapsDetect.js +6 -5
- package/dist/mcp/handlers/analysis/coverageGapsDetect.js.map +1 -1
- package/dist/mcp/handlers/analysis/performance-monitor-realtime-handler.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/performance-monitor-realtime-handler.js +5 -4
- package/dist/mcp/handlers/analysis/performance-monitor-realtime-handler.js.map +1 -1
- package/dist/mcp/handlers/analysis/performanceBenchmarkRun.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/performanceBenchmarkRun.js +8 -7
- package/dist/mcp/handlers/analysis/performanceBenchmarkRun.js.map +1 -1
- package/dist/mcp/handlers/analysis/performanceMonitorRealtime.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/performanceMonitorRealtime.js +7 -6
- package/dist/mcp/handlers/analysis/performanceMonitorRealtime.js.map +1 -1
- package/dist/mcp/handlers/analysis/securityScanComprehensive.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/securityScanComprehensive.js +18 -21
- package/dist/mcp/handlers/analysis/securityScanComprehensive.js.map +1 -1
- package/dist/mcp/handlers/base-handler.d.ts.map +1 -1
- package/dist/mcp/handlers/base-handler.js +2 -9
- package/dist/mcp/handlers/base-handler.js.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-failure.d.ts.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-failure.js +4 -3
- package/dist/mcp/handlers/chaos/chaos-inject-failure.js.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-latency.d.ts.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-latency.js +6 -5
- package/dist/mcp/handlers/chaos/chaos-inject-latency.js.map +1 -1
- package/dist/mcp/handlers/coordination/event-emit.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/event-emit.js +2 -1
- package/dist/mcp/handlers/coordination/event-emit.js.map +1 -1
- package/dist/mcp/handlers/coordination/event-subscribe.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/event-subscribe.js +2 -1
- package/dist/mcp/handlers/coordination/event-subscribe.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-checkpoint.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-checkpoint.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-checkpoint.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-create.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-create.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-create.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-execute.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-execute.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-execute.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-resume.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-resume.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-resume.js.map +1 -1
- package/dist/mcp/handlers/fleet-init.d.ts.map +1 -1
- package/dist/mcp/handlers/fleet-init.js +2 -1
- package/dist/mcp/handlers/fleet-init.js.map +1 -1
- package/dist/mcp/handlers/fleet-status.d.ts.map +1 -1
- package/dist/mcp/handlers/fleet-status.js +31 -30
- package/dist/mcp/handlers/fleet-status.js.map +1 -1
- package/dist/mcp/handlers/integration/dependency-check.d.ts.map +1 -1
- package/dist/mcp/handlers/integration/dependency-check.js +3 -2
- package/dist/mcp/handlers/integration/dependency-check.js.map +1 -1
- package/dist/mcp/handlers/integration/integration-test-orchestrate.d.ts.map +1 -1
- package/dist/mcp/handlers/integration/integration-test-orchestrate.js +2 -1
- package/dist/mcp/handlers/integration/integration-test-orchestrate.js.map +1 -1
- package/dist/mcp/handlers/optimize-tests.d.ts.map +1 -1
- package/dist/mcp/handlers/optimize-tests.js +33 -32
- package/dist/mcp/handlers/optimize-tests.js.map +1 -1
- package/dist/mcp/handlers/predict-defects.d.ts.map +1 -1
- package/dist/mcp/handlers/predict-defects.js +46 -45
- package/dist/mcp/handlers/predict-defects.js.map +1 -1
- package/dist/mcp/handlers/prediction/deployment-readiness-check.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/deployment-readiness-check.js +24 -23
- package/dist/mcp/handlers/prediction/deployment-readiness-check.js.map +1 -1
- package/dist/mcp/handlers/prediction/predict-defects-ai.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/predict-defects-ai.js +10 -9
- package/dist/mcp/handlers/prediction/predict-defects-ai.js.map +1 -1
- package/dist/mcp/handlers/prediction/regression-risk-analyze.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/regression-risk-analyze.js +10 -9
- package/dist/mcp/handlers/prediction/regression-risk-analyze.js.map +1 -1
- package/dist/mcp/handlers/prediction/visual-test-regression.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/visual-test-regression.js +7 -6
- package/dist/mcp/handlers/prediction/visual-test-regression.js.map +1 -1
- package/dist/mcp/handlers/quality-analyze.d.ts.map +1 -1
- package/dist/mcp/handlers/quality-analyze.js +53 -52
- package/dist/mcp/handlers/quality-analyze.js.map +1 -1
- package/dist/mcp/handlers/task-orchestrate.d.ts.map +1 -1
- package/dist/mcp/handlers/task-orchestrate.js +19 -18
- package/dist/mcp/handlers/task-orchestrate.js.map +1 -1
- package/dist/mcp/handlers/test/test-execute-parallel.d.ts.map +1 -1
- package/dist/mcp/handlers/test/test-execute-parallel.js +7 -6
- package/dist/mcp/handlers/test/test-execute-parallel.js.map +1 -1
- package/dist/mcp/handlers/test/test-generate-enhanced.d.ts.map +1 -1
- package/dist/mcp/handlers/test/test-generate-enhanced.js +2 -1
- package/dist/mcp/handlers/test/test-generate-enhanced.js.map +1 -1
- package/dist/mcp/handlers/test/test-optimize-sublinear.d.ts.map +1 -1
- package/dist/mcp/handlers/test/test-optimize-sublinear.js +3 -2
- package/dist/mcp/handlers/test/test-optimize-sublinear.js.map +1 -1
- package/dist/mcp/handlers/test-execute.d.ts.map +1 -1
- package/dist/mcp/handlers/test-execute.js +11 -10
- package/dist/mcp/handlers/test-execute.js.map +1 -1
- package/dist/mcp/handlers/test-generate.d.ts.map +1 -1
- package/dist/mcp/handlers/test-generate.js +4 -3
- package/dist/mcp/handlers/test-generate.js.map +1 -1
- package/dist/mcp/server.d.ts +4 -4
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
- package/dist/mcp/services/AgentRegistry.js +9 -2
- package/dist/mcp/services/AgentRegistry.js.map +1 -1
- package/dist/mcp/streaming/CoverageAnalyzeStreamHandler.d.ts.map +1 -1
- package/dist/mcp/streaming/CoverageAnalyzeStreamHandler.js +10 -9
- package/dist/mcp/streaming/CoverageAnalyzeStreamHandler.js.map +1 -1
- package/dist/mcp/streaming/StreamingMCPTool.d.ts.map +1 -1
- package/dist/mcp/streaming/StreamingMCPTool.js +2 -1
- package/dist/mcp/streaming/StreamingMCPTool.js.map +1 -1
- package/dist/mcp/streaming/TestExecuteStreamHandler.d.ts.map +1 -1
- package/dist/mcp/streaming/TestExecuteStreamHandler.js +6 -5
- package/dist/mcp/streaming/TestExecuteStreamHandler.js.map +1 -1
- package/dist/reasoning/TestTemplateCreator.d.ts +10 -2
- package/dist/reasoning/TestTemplateCreator.d.ts.map +1 -1
- package/dist/reasoning/TestTemplateCreator.js +81 -21
- package/dist/reasoning/TestTemplateCreator.js.map +1 -1
- package/dist/transport/QUICTransport.d.ts +340 -0
- package/dist/transport/QUICTransport.d.ts.map +1 -0
- package/dist/transport/QUICTransport.js +814 -0
- package/dist/transport/QUICTransport.js.map +1 -0
- package/dist/transport/UDPTransport.d.ts +348 -0
- package/dist/transport/UDPTransport.d.ts.map +1 -0
- package/dist/transport/UDPTransport.js +820 -0
- package/dist/transport/UDPTransport.js.map +1 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/index.d.ts +37 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/pattern.types.d.ts +39 -3
- package/dist/types/pattern.types.d.ts.map +1 -1
- package/dist/types/quic.d.ts +339 -0
- package/dist/types/quic.d.ts.map +1 -0
- package/dist/types/quic.js +48 -0
- package/dist/types/quic.js.map +1 -0
- package/dist/utils/Config.js +3 -3
- package/dist/utils/Config.js.map +1 -1
- package/dist/utils/Database.d.ts +14 -0
- package/dist/utils/Database.d.ts.map +1 -1
- package/dist/utils/Database.js +51 -4
- package/dist/utils/Database.js.map +1 -1
- package/dist/utils/Logger.d.ts.map +1 -1
- package/dist/utils/Logger.js +111 -26
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ProcessExit.d.ts +23 -0
- package/dist/utils/ProcessExit.d.ts.map +1 -0
- package/dist/utils/ProcessExit.js +40 -0
- package/dist/utils/ProcessExit.js.map +1 -0
- package/dist/utils/SecureRandom.d.ts +171 -0
- package/dist/utils/SecureRandom.d.ts.map +1 -0
- package/dist/utils/SecureRandom.js +229 -0
- package/dist/utils/SecureRandom.js.map +1 -0
- package/dist/utils/SecureUrlValidator.d.ts +167 -0
- package/dist/utils/SecureUrlValidator.d.ts.map +1 -0
- package/dist/utils/SecureUrlValidator.js +306 -0
- package/dist/utils/SecureUrlValidator.js.map +1 -0
- package/dist/utils/SecureValidation.d.ts +131 -0
- package/dist/utils/SecureValidation.d.ts.map +1 -0
- package/dist/utils/SecureValidation.js +265 -0
- package/dist/utils/SecureValidation.js.map +1 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +5 -4
- package/dist/utils/validation.js.map +1 -1
- package/package.json +31 -8
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd-london-chicago
|
|
3
|
+
description: Apply both London and Chicago school TDD approaches. Use when practicing test-driven development, understanding different TDD philosophies, or choosing the right testing style for your context.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: development
|
|
6
|
+
tags: [tdd, test-driven-development, london-school, chicago-school, mocking, red-green-refactor]
|
|
7
|
+
difficulty: intermediate
|
|
8
|
+
estimated_time: 2-4 hours
|
|
9
|
+
author: user
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Test-Driven Development: London & Chicago Schools
|
|
13
|
+
|
|
14
|
+
## TDD Core Cycle (Both Schools)
|
|
15
|
+
|
|
16
|
+
**Red → Green → Refactor**
|
|
17
|
+
|
|
18
|
+
1. **Red:** Write a failing test for the next bit of functionality
|
|
19
|
+
2. **Green:** Write just enough code to make the test pass
|
|
20
|
+
3. **Refactor:** Improve the code without changing behavior
|
|
21
|
+
|
|
22
|
+
**Key principle:** Tests drive design, not just verify it.
|
|
23
|
+
|
|
24
|
+
## Chicago School (Detroit School / Classicist)
|
|
25
|
+
|
|
26
|
+
### Philosophy
|
|
27
|
+
Test observable behavior through the public API. Focus on state verification. Keep tests close to how users/consumers will interact with the code.
|
|
28
|
+
|
|
29
|
+
### Approach
|
|
30
|
+
- Write tests against real objects
|
|
31
|
+
- Minimize use of mocks/stubs
|
|
32
|
+
- Tests typically involve multiple units working together
|
|
33
|
+
- Inside-out or outside-in (both work)
|
|
34
|
+
|
|
35
|
+
### Example: Order Processing
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
// Test
|
|
39
|
+
describe('Order', () => {
|
|
40
|
+
it('calculates total with tax', () => {
|
|
41
|
+
const order = new Order();
|
|
42
|
+
order.addItem(new Product('Widget', 10.00), 2);
|
|
43
|
+
order.addItem(new Product('Gadget', 15.00), 1);
|
|
44
|
+
|
|
45
|
+
expect(order.totalWithTax(0.10)).toBe(38.50); // (10*2 + 15) * 1.10
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Implementation
|
|
50
|
+
class Order {
|
|
51
|
+
constructor() {
|
|
52
|
+
this.items = [];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
addItem(product, quantity) {
|
|
56
|
+
this.items.push({ product, quantity });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
totalWithTax(taxRate) {
|
|
60
|
+
const subtotal = this.items.reduce((sum, item) =>
|
|
61
|
+
sum + (item.product.price * item.quantity), 0
|
|
62
|
+
);
|
|
63
|
+
return subtotal * (1 + taxRate);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
class Product {
|
|
68
|
+
constructor(name, price) {
|
|
69
|
+
this.name = name;
|
|
70
|
+
this.price = price;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Characteristics
|
|
76
|
+
- **Real collaborators:** Order uses actual Product objects
|
|
77
|
+
- **State verification:** Assert on the final total
|
|
78
|
+
- **Integrated test:** Multiple objects work together
|
|
79
|
+
- **Refactoring safety:** Can change internal implementation freely
|
|
80
|
+
|
|
81
|
+
### When Chicago Shines
|
|
82
|
+
- Domain logic with clear state
|
|
83
|
+
- Algorithms and calculations
|
|
84
|
+
- When object interactions are simple
|
|
85
|
+
- When integration between units is the key concern
|
|
86
|
+
- Learning a new domain (seeing real objects helps understanding)
|
|
87
|
+
|
|
88
|
+
## London School (Mockist)
|
|
89
|
+
|
|
90
|
+
### Philosophy
|
|
91
|
+
Test each unit in isolation. Focus on interaction verification. Design emerges through defining interfaces and collaborations first.
|
|
92
|
+
|
|
93
|
+
### Approach
|
|
94
|
+
- Mock external dependencies
|
|
95
|
+
- Outside-in development (start from entry point)
|
|
96
|
+
- Tests focus on how objects collaborate
|
|
97
|
+
- Discover interfaces through testing
|
|
98
|
+
|
|
99
|
+
### Example: Order Processing
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
// Test
|
|
103
|
+
describe('Order', () => {
|
|
104
|
+
it('calculates total using tax calculator', () => {
|
|
105
|
+
const taxCalculator = {
|
|
106
|
+
calculateTax: jest.fn().mockReturnValue(3.50)
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const order = new Order(taxCalculator);
|
|
110
|
+
order.addItem({ price: 10 }, 2);
|
|
111
|
+
order.addItem({ price: 15 }, 1);
|
|
112
|
+
|
|
113
|
+
const total = order.totalWithTax();
|
|
114
|
+
|
|
115
|
+
expect(taxCalculator.calculateTax).toHaveBeenCalledWith(35.00);
|
|
116
|
+
expect(total).toBe(38.50);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// Implementation
|
|
121
|
+
class Order {
|
|
122
|
+
constructor(taxCalculator) {
|
|
123
|
+
this.taxCalculator = taxCalculator;
|
|
124
|
+
this.items = [];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
addItem(product, quantity) {
|
|
128
|
+
this.items.push({ product, quantity });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
totalWithTax() {
|
|
132
|
+
const subtotal = this.items.reduce((sum, item) =>
|
|
133
|
+
sum + (item.product.price * item.quantity), 0
|
|
134
|
+
);
|
|
135
|
+
const tax = this.taxCalculator.calculateTax(subtotal);
|
|
136
|
+
return subtotal + tax;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Characteristics
|
|
142
|
+
- **Mocked collaborators:** TaxCalculator is mocked
|
|
143
|
+
- **Interaction verification:** Assert that calculateTax was called correctly
|
|
144
|
+
- **Isolated test:** Order tested independently
|
|
145
|
+
- **Explicit dependencies:** Constructor reveals what Order needs
|
|
146
|
+
|
|
147
|
+
### When London Shines
|
|
148
|
+
- Complex object interactions
|
|
149
|
+
- External dependencies (databases, APIs, file systems)
|
|
150
|
+
- When testing would be slow without mocks
|
|
151
|
+
- Designing new systems (interfaces emerge naturally)
|
|
152
|
+
- Code with heavy I/O or side effects
|
|
153
|
+
|
|
154
|
+
## Key Differences
|
|
155
|
+
|
|
156
|
+
| Aspect | Chicago | London |
|
|
157
|
+
|--------|---------|--------|
|
|
158
|
+
| **Collaborators** | Real objects | Mocks/stubs |
|
|
159
|
+
| **Verification** | State (assert outcomes) | Interaction (assert method calls) |
|
|
160
|
+
| **Isolation** | Lower (integrated units) | Higher (unit in isolation) |
|
|
161
|
+
| **Refactoring** | Easier (fewer test changes) | Harder (mocks may break) |
|
|
162
|
+
| **Design feedback** | Emerge from use | Explicit from start |
|
|
163
|
+
| **Test speed** | Can be slower | Usually faster |
|
|
164
|
+
|
|
165
|
+
## Practical Guidance: Which to Use?
|
|
166
|
+
|
|
167
|
+
### Use Chicago When:
|
|
168
|
+
- **Pure functions and calculations**
|
|
169
|
+
- `calculateDiscount(price, percentage)`
|
|
170
|
+
- `formatCurrency(amount)`
|
|
171
|
+
|
|
172
|
+
- **Value objects**
|
|
173
|
+
- `Money`, `Email`, `PhoneNumber`
|
|
174
|
+
|
|
175
|
+
- **Simple collaborations**
|
|
176
|
+
- Few dependencies, straightforward interactions
|
|
177
|
+
|
|
178
|
+
- **Learning phase**
|
|
179
|
+
- Understanding domain, exploring design
|
|
180
|
+
|
|
181
|
+
### Use London When:
|
|
182
|
+
- **External integrations**
|
|
183
|
+
- Database access, API calls, file I/O
|
|
184
|
+
|
|
185
|
+
- **Command patterns**
|
|
186
|
+
- Actions that change state elsewhere
|
|
187
|
+
|
|
188
|
+
- **Complex workflows**
|
|
189
|
+
- Multiple objects coordinating
|
|
190
|
+
|
|
191
|
+
- **Slow operations**
|
|
192
|
+
- Network calls, heavy computations
|
|
193
|
+
|
|
194
|
+
### Mix Both (Common in Practice)
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
// London style for controller (external dependencies)
|
|
198
|
+
describe('OrderController', () => {
|
|
199
|
+
it('creates order and sends confirmation', async () => {
|
|
200
|
+
const orderService = { create: jest.fn().mockResolvedValue({ id: 123 }) };
|
|
201
|
+
const emailService = { send: jest.fn() };
|
|
202
|
+
|
|
203
|
+
const controller = new OrderController(orderService, emailService);
|
|
204
|
+
await controller.placeOrder(orderData);
|
|
205
|
+
|
|
206
|
+
expect(orderService.create).toHaveBeenCalledWith(orderData);
|
|
207
|
+
expect(emailService.send).toHaveBeenCalled();
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// Chicago style for domain logic (calculations)
|
|
212
|
+
describe('OrderService', () => {
|
|
213
|
+
it('applies discount when threshold met', () => {
|
|
214
|
+
const service = new OrderService();
|
|
215
|
+
const order = service.create({ items: [...], total: 150 });
|
|
216
|
+
|
|
217
|
+
expect(order.discount).toBe(15); // 10% off orders > $100
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Common Pitfalls
|
|
223
|
+
|
|
224
|
+
### Over-Mocking (London)
|
|
225
|
+
**Problem:** Mocking everything makes tests brittle.
|
|
226
|
+
|
|
227
|
+
```javascript
|
|
228
|
+
// TOO MUCH MOCKING
|
|
229
|
+
const product = { getName: jest.fn(), getPrice: jest.fn() };
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Better:** Only mock external dependencies and complex collaborators.
|
|
233
|
+
|
|
234
|
+
### Under-Testing (Chicago)
|
|
235
|
+
**Problem:** Integration tests miss edge cases in individual units.
|
|
236
|
+
|
|
237
|
+
**Solution:** Add unit tests for complex logic, keep integration tests for happy paths.
|
|
238
|
+
|
|
239
|
+
### Mocking Implementation Details (London)
|
|
240
|
+
**Problem:** Tests break when refactoring internals.
|
|
241
|
+
|
|
242
|
+
```javascript
|
|
243
|
+
// BAD - testing private method call
|
|
244
|
+
expect(order._calculateSubtotal).toHaveBeenCalled();
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Better:** Test public behavior, not internal methods.
|
|
248
|
+
|
|
249
|
+
### Ignoring Test Pain (Both)
|
|
250
|
+
**Problem:** Hard-to-test code = poorly designed code.
|
|
251
|
+
|
|
252
|
+
**Listen to tests:**
|
|
253
|
+
- Need many mocks? → Too many dependencies
|
|
254
|
+
- Hard to set up? → Constructor does too much
|
|
255
|
+
- Tests too long? → Method does too much
|
|
256
|
+
- Can't test without real database? → Coupling to infrastructure
|
|
257
|
+
|
|
258
|
+
## TDD Rhythm
|
|
259
|
+
|
|
260
|
+
### Micro-Level (Minutes)
|
|
261
|
+
1. Write tiny failing test
|
|
262
|
+
2. Write minimal code to pass
|
|
263
|
+
3. Quick refactor
|
|
264
|
+
4. Repeat
|
|
265
|
+
|
|
266
|
+
### Macro-Level (Hours)
|
|
267
|
+
1. Sketch out component responsibilities
|
|
268
|
+
2. TDD the easiest piece first
|
|
269
|
+
3. TDD the next piece
|
|
270
|
+
4. Refactor across components
|
|
271
|
+
5. Continue building out
|
|
272
|
+
|
|
273
|
+
### Red-Green-Refactor Discipline
|
|
274
|
+
|
|
275
|
+
**Red phase:**
|
|
276
|
+
- Run test, verify it fails
|
|
277
|
+
- Check failure message is clear
|
|
278
|
+
- Don't write production code yet
|
|
279
|
+
|
|
280
|
+
**Green phase:**
|
|
281
|
+
- Write simplest code to pass
|
|
282
|
+
- Don't add features not tested yet
|
|
283
|
+
- Don't refactor yet
|
|
284
|
+
- Verify test passes
|
|
285
|
+
|
|
286
|
+
**Refactor phase:**
|
|
287
|
+
- Improve code structure
|
|
288
|
+
- Keep tests passing
|
|
289
|
+
- Stop when code is clean enough
|
|
290
|
+
- Don't add new functionality
|
|
291
|
+
|
|
292
|
+
## Examples of Good TDD Flow
|
|
293
|
+
|
|
294
|
+
### Chicago Example: Shopping Cart
|
|
295
|
+
|
|
296
|
+
```javascript
|
|
297
|
+
// Test 1: Empty cart
|
|
298
|
+
test('new cart has zero items', () => {
|
|
299
|
+
const cart = new Cart();
|
|
300
|
+
expect(cart.itemCount()).toBe(0);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
// Make it pass
|
|
304
|
+
class Cart {
|
|
305
|
+
itemCount() { return 0; }
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Test 2: Add item
|
|
309
|
+
test('adding item increases count', () => {
|
|
310
|
+
const cart = new Cart();
|
|
311
|
+
cart.add({ id: 1, name: 'Widget' });
|
|
312
|
+
expect(cart.itemCount()).toBe(1);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// Make it pass
|
|
316
|
+
class Cart {
|
|
317
|
+
constructor() { this.items = []; }
|
|
318
|
+
add(item) { this.items.push(item); }
|
|
319
|
+
itemCount() { return this.items.length; }
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Refactor: Extract to method
|
|
323
|
+
class Cart {
|
|
324
|
+
constructor() { this.items = []; }
|
|
325
|
+
add(item) { this.items.push(item); }
|
|
326
|
+
itemCount() { return this.items.length; }
|
|
327
|
+
}
|
|
328
|
+
// (No refactor needed yet - code is simple)
|
|
329
|
+
|
|
330
|
+
// Continue with more tests...
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### London Example: Payment Processor
|
|
334
|
+
|
|
335
|
+
```javascript
|
|
336
|
+
// Test: Successful payment
|
|
337
|
+
test('charges card and records transaction', async () => {
|
|
338
|
+
const gateway = { charge: jest.fn().mockResolvedValue({ success: true }) };
|
|
339
|
+
const ledger = { record: jest.fn() };
|
|
340
|
+
|
|
341
|
+
const processor = new PaymentProcessor(gateway, ledger);
|
|
342
|
+
const result = await processor.process({ amount: 100, card: '1234' });
|
|
343
|
+
|
|
344
|
+
expect(gateway.charge).toHaveBeenCalledWith(100, '1234');
|
|
345
|
+
expect(ledger.record).toHaveBeenCalled();
|
|
346
|
+
expect(result.success).toBe(true);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
// Implementation
|
|
350
|
+
class PaymentProcessor {
|
|
351
|
+
constructor(gateway, ledger) {
|
|
352
|
+
this.gateway = gateway;
|
|
353
|
+
this.ledger = ledger;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
async process(payment) {
|
|
357
|
+
const result = await this.gateway.charge(payment.amount, payment.card);
|
|
358
|
+
if (result.success) {
|
|
359
|
+
this.ledger.record({ amount: payment.amount, timestamp: Date.now() });
|
|
360
|
+
}
|
|
361
|
+
return result;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## Benefits of TDD (Both Schools)
|
|
367
|
+
|
|
368
|
+
1. **Design feedback:** Tests show design problems early
|
|
369
|
+
2. **Living documentation:** Tests explain how code should work
|
|
370
|
+
3. **Regression safety:** Changes don't break existing behavior
|
|
371
|
+
4. **Confidence:** Refactor without fear
|
|
372
|
+
5. **Scope control:** Build only what's tested
|
|
373
|
+
6. **Debugging speed:** Failing test pinpoints issue
|
|
374
|
+
|
|
375
|
+
## When NOT to Use TDD
|
|
376
|
+
|
|
377
|
+
- **Spike/prototype code:** You're exploring, not building yet
|
|
378
|
+
- **Trivial code:** Getters/setters with no logic
|
|
379
|
+
- **UI layout:** Visual design isn't well suited to TDD
|
|
380
|
+
- **Performance optimization:** Measure first, optimize second
|
|
381
|
+
- **Learning new tech:** Get something working first, then test
|
|
382
|
+
|
|
383
|
+
## Misconceptions
|
|
384
|
+
|
|
385
|
+
**"TDD means 100% code coverage"**
|
|
386
|
+
No. TDD means tests drive development. Some code naturally emerges without direct tests (e.g., simple DTOs).
|
|
387
|
+
|
|
388
|
+
**"TDD is slower"**
|
|
389
|
+
Slower at first, faster overall. You debug less and refactor safely.
|
|
390
|
+
|
|
391
|
+
**"Tests guarantee correctness"**
|
|
392
|
+
No. Tests only verify what you thought to test. You can still miss requirements or have logical errors.
|
|
393
|
+
|
|
394
|
+
**"Must test private methods"**
|
|
395
|
+
No. Test through public API. If private method is complex enough to need tests, maybe it's actually a separate class.
|
|
396
|
+
|
|
397
|
+
## Combining with Other Practices
|
|
398
|
+
|
|
399
|
+
**TDD + Pair Programming:**
|
|
400
|
+
- Navigator writes test
|
|
401
|
+
- Driver makes it pass
|
|
402
|
+
- Switch roles frequently
|
|
403
|
+
|
|
404
|
+
**TDD + Continuous Integration:**
|
|
405
|
+
- Every commit has tests
|
|
406
|
+
- CI runs full suite
|
|
407
|
+
- Green build = deployable
|
|
408
|
+
|
|
409
|
+
**TDD + Refactoring:**
|
|
410
|
+
- Tests enable fearless refactoring
|
|
411
|
+
- Refactoring keeps tests maintainable
|
|
412
|
+
- Symbiotic relationship
|
|
413
|
+
|
|
414
|
+
## Resources
|
|
415
|
+
|
|
416
|
+
### Chicago School
|
|
417
|
+
- **Test-Driven Development by Example** by Kent Beck
|
|
418
|
+
- **Growing Object-Oriented Software Guided by Tests** by Freeman & Pryce (hybrid)
|
|
419
|
+
|
|
420
|
+
### London School
|
|
421
|
+
- **GOOS** by Freeman & Pryce (literally wrote the book)
|
|
422
|
+
- Martin Fowler's articles on mocks vs. stubs
|
|
423
|
+
|
|
424
|
+
### General
|
|
425
|
+
- **Working Effectively with Legacy Code** by Michael Feathers
|
|
426
|
+
- Uncle Bob's TDD screencasts
|
|
427
|
+
|
|
428
|
+
## Using with QE Agents
|
|
429
|
+
|
|
430
|
+
### Agent-Assisted TDD Workflows
|
|
431
|
+
|
|
432
|
+
**qe-test-generator** applies both schools:
|
|
433
|
+
```typescript
|
|
434
|
+
// Chicago style: Generate state-based tests
|
|
435
|
+
await agent.generateTests({
|
|
436
|
+
style: 'chicago',
|
|
437
|
+
target: 'src/domain/Order.ts',
|
|
438
|
+
focus: 'state-verification'
|
|
439
|
+
});
|
|
440
|
+
// → Creates tests that verify final state
|
|
441
|
+
|
|
442
|
+
// London style: Generate interaction-based tests
|
|
443
|
+
await agent.generateTests({
|
|
444
|
+
style: 'london',
|
|
445
|
+
target: 'src/controllers/OrderController.ts',
|
|
446
|
+
focus: 'collaboration-patterns'
|
|
447
|
+
});
|
|
448
|
+
// → Creates tests with mocked dependencies
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Red-Green-Refactor with Agent Assistance
|
|
452
|
+
|
|
453
|
+
```typescript
|
|
454
|
+
// Red: Human writes failing test concept
|
|
455
|
+
const testIdea = "Order applies 10% discount when total > $100";
|
|
456
|
+
|
|
457
|
+
// Agent generates formal test (Red)
|
|
458
|
+
const failingTest = await qe-test-generator.createFailingTest(testIdea);
|
|
459
|
+
// → Generates complete test that fails
|
|
460
|
+
|
|
461
|
+
// Human writes minimal code (Green)
|
|
462
|
+
// ... implementation code ...
|
|
463
|
+
|
|
464
|
+
// Agent validates green phase
|
|
465
|
+
await qe-test-executor.verifyGreen(failingTest);
|
|
466
|
+
// → Confirms test passes
|
|
467
|
+
|
|
468
|
+
// Agent suggests refactorings
|
|
469
|
+
const suggestions = await qe-quality-analyzer.suggestRefactorings({
|
|
470
|
+
scope: 'src/domain/Order.ts',
|
|
471
|
+
preserveTests: true
|
|
472
|
+
});
|
|
473
|
+
// → Provides safe refactoring options
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Agent-Human Pairing Patterns
|
|
477
|
+
|
|
478
|
+
**Ping-Pong TDD with Agent:**
|
|
479
|
+
```typescript
|
|
480
|
+
// Human writes test
|
|
481
|
+
const humanTest = `
|
|
482
|
+
test('cart applies bulk discount', () => {
|
|
483
|
+
const cart = new Cart();
|
|
484
|
+
cart.addItems(10);
|
|
485
|
+
expect(cart.discount()).toBe(15);
|
|
486
|
+
});
|
|
487
|
+
`;
|
|
488
|
+
|
|
489
|
+
// Agent makes it pass
|
|
490
|
+
await qe-test-generator.implementTestLogic(humanTest);
|
|
491
|
+
// → Generates minimal implementation
|
|
492
|
+
|
|
493
|
+
// Agent writes next test
|
|
494
|
+
const agentTest = await qe-test-generator.nextTest({
|
|
495
|
+
context: 'bulk-discount-edge-cases',
|
|
496
|
+
style: 'chicago'
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
// Human reviews and refines
|
|
500
|
+
// [repeat cycle]
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### Fleet Coordination for TDD
|
|
504
|
+
|
|
505
|
+
```typescript
|
|
506
|
+
// Multiple agents support TDD workflow
|
|
507
|
+
const tddFleet = await FleetManager.coordinate({
|
|
508
|
+
workflow: 'red-green-refactor',
|
|
509
|
+
agents: {
|
|
510
|
+
testGenerator: 'qe-test-generator', // Red phase
|
|
511
|
+
testExecutor: 'qe-test-executor', // Green validation
|
|
512
|
+
qualityAnalyzer: 'qe-quality-analyzer' // Refactor suggestions
|
|
513
|
+
},
|
|
514
|
+
mode: 'sequential'
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
// Agents coordinate through TDD cycle
|
|
518
|
+
await tddFleet.executeCycle({
|
|
519
|
+
feature: 'payment-processing',
|
|
520
|
+
school: 'mixed' // Use both Chicago and London where appropriate
|
|
521
|
+
});
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### Choosing TDD School with Agent Guidance
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
// Agent analyzes code and recommends TDD approach
|
|
528
|
+
const recommendation = await qe-quality-analyzer.recommendTDDStyle({
|
|
529
|
+
codeType: 'controller',
|
|
530
|
+
dependencies: ['database', 'emailService', 'paymentGateway'],
|
|
531
|
+
complexity: 'high'
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
// → Recommends London school (many external dependencies)
|
|
535
|
+
// → Suggests mock patterns for database and services
|
|
536
|
+
// → Provides example test structure
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
---
|
|
540
|
+
|
|
541
|
+
## Related Skills
|
|
542
|
+
|
|
543
|
+
**Core Quality Practices:**
|
|
544
|
+
- [agentic-quality-engineering](../agentic-quality-engineering/) - TDD with agent coordination
|
|
545
|
+
- [context-driven-testing](../context-driven-testing/) - Choose TDD style based on context
|
|
546
|
+
|
|
547
|
+
**Development Practices:**
|
|
548
|
+
- [xp-practices](../xp-practices/) - TDD within XP workflow, ping-pong pairing
|
|
549
|
+
- [refactoring-patterns](../refactoring-patterns/) - Refactor phase techniques
|
|
550
|
+
- [code-review-quality](../code-review-quality/) - Review test quality
|
|
551
|
+
|
|
552
|
+
**Testing Approaches:**
|
|
553
|
+
- [test-automation-strategy](../test-automation-strategy/) - Where TDD fits in automation pyramid
|
|
554
|
+
- [api-testing-patterns](../api-testing-patterns/) - London school for API testing
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
558
|
+
## Remember
|
|
559
|
+
|
|
560
|
+
**Chicago:** Test state, use real objects, refactor freely
|
|
561
|
+
**London:** Test interactions, mock dependencies, design interfaces first
|
|
562
|
+
|
|
563
|
+
**Both:** Write the test first, make it pass, refactor
|
|
564
|
+
|
|
565
|
+
Neither is "right." Choose based on context. Mix as needed. The goal is well-designed, tested code, not religious adherence to one school.
|
|
566
|
+
|
|
567
|
+
**With Agents**: Agents excel at generating tests in both schools, validating green phase, and suggesting safe refactorings. Use agents to maintain TDD discipline while humans focus on design decisions.
|