Aurora QA🤖
  ](https://pnpm.io) ](https://nodejs.org)
人工智能驱动的自主质量工程平台——13个专业代理、混沌工程、自愈测试、MCP服务器和实时仪表板
Aurora QA是一个智能质量工程平台,它使用Claude自主生成测试、查找错误、分析代码安全性、衡量性能并确保可访问性。它有13个专门的人工智能代理,通过一个管道系统进行编排,并由一个基于向量的知识记忆作为支持,从每次分析中学习。
该平台通过模型上下文协议(MCP)、GitHub Actions、GitLab CI和Jenkins的CI/CD适配器以及用于监控的实时Next.js仪表板与您的开发工作流程集成。
✨ 特性
- 🧪 AI测试生成 --生成涵盖边缘情况、错误路径和快乐路径的全面测试套件
- 🐛 智能Bug检测 --基于人工智能推理的复杂漏洞深度静态分析
- 🔒 OWASP安全扫描 --SQL注入、XSS、秘密检测、身份验证分析
- ⚡ 性能分析 --大O估计、N+1查询、内存泄漏检测
- ♿ 可访问性检查 --HTML和React的WCAG 2.1 AA合规性分析
- 🔥 混沌工程 --网络延迟/故障注入、CPU压力、内存压力、时间偏差
- 🧬 变异测试 --通过生成代码突变来衡量测试质量
- 📋 合约测试 -受Pact启发的API合同验证
- 🩹 自我修复测试 --自动分类和修复片状测试
- 🎭 浏览器自动化 --基于AI的语义元素定位与Playwright
- 🧠 知识记忆 --TF-IDF矢量存储从每个分析会话中学习
- 🛡️ 断路器 --连续失败后自动停止代理,以防止令牌浪费
- ⏱️ 超时控制 -基于AbortController-based API超时,性能下降缓慢
- 📊 实时仪表盘 --Next.js 15仪表板,带有SSE实时更新
- 🔌 MCP集成 --Claude Desktop、Cursor、VS Code提供12种工具
🏗 建筑
┌──────────────────────────────────────────────────────────────┐
│ Aurora QA Platform │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────── Orchestrator ────────────────────────┐ │
│ │ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌──────────────────┐ │ │
│ │ │ TestGen │ │ TestRunner │ │ BugAnalyzer │ │ │
│ │ │ Agent │ │ Agent │ │ Agent │ │ │
│ │ └─────────────┘ └─────────────┘ └──────────────────┘ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌──────────────────┐ │ │
│ │ │ Coverage │ │ Review │ │ Healer │ │ │
│ │ │ Agent │ │ Agent │ │ Agent │ │ │
│ │ └─────────────┘ └─────────────┘ └──────────────────┘ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌──────────────────┐ │ │
│ │ │ Security │ │ Performance │ │ Accessibility │ │ │
│ │ │ Agent │ │ Agent │ │ Agent │ │ │
│ │ └─────────────┘ └─────────────┘ └──────────────────┘ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌──────────────────┐ │ │
│ │ │ Chaos │ │ Mutation │ │ Contract │ │ │
│ │ │ Agent │ │ Agent │ │ Agent │ │ │
│ │ └─────────────┘ └─────────────┘ └──────────────────┘ │ │
│ │ ┌─────────────┐ │ │
│ │ │ Playwright │ Pipeline Runner │ │
│ │ │ Agent │ (topological execution) │ │
│ │ └─────────────┘ │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ ┌─── Memory Layer ───┐ ┌── Intelligence ──┐ ┌── Events ──┐│
│ │ VectorStore (TF-IDF│ │ ReasoningEngine │ │ EventStream││
│ │ KnowledgeBase │ │ TestPrioritizer │ │ (SSE) ││
│ │ EpisodicMemory │ └──────────────────┘ └────────────┘│
│ │ PatternLibrary │ ┌── Metrics ────────┐ │
│ │ WorkingMemory │ │ MetricsCollector │ │
│ └────────────────────┘ │ (Prometheus fmt) │ │
│ └───────────────────┘ │
├──────────────────────────────────────────────────────────────┤
│ MCP Server (12 tools) │ Dashboard (Next.js 15) │ CI/CD │
└──────────────────────────────────────────────────────────────┘🚀 快速开始
# 1. Clone the repository
git clone https://github.com/Zijian-Ni/aurora-qa.git && cd aurora-qa
# 2. Install dependencies
pnpm install
# 3. Build all packages
pnpm build
# 4. Set your API key
export ANTHROPIC_API_KEY=sk-ant-...
# 5. Run an example
node_modules/.bin/tsx examples/basic-pipeline/index.ts📖 API使用
import { Orchestrator, loadConfig } from '@aurora-qa/core';
// Initialize with config
const config = loadConfig({ anthropicApiKey: process.env.ANTHROPIC_API_KEY! });
const orchestrator = new Orchestrator({ config });
// Generate tests for a source file
const testOutput = await orchestrator.generateTests({
sourceCode: 'export function add(a: number, b: number) { return a + b; }',
filePath: 'src/math.ts',
framework: 'vitest',
});
// Run security scan
const securityReport = await orchestrator.scanSecurity(
'const query = `SELECT * FROM users WHERE id = ${userId}`;',
'src/db.ts',
);
// Analyze performance
const perfAnalysis = await orchestrator.analyzePerformance(
'for (const user of users) { await db.find(user.id); }',
'typescript',
);
// Run a full pipeline
const run = await orchestrator.runPipeline({
id: 'my-pipeline',
name: 'Full QA',
steps: [
{ id: 'gen', type: 'generate-tests', name: 'Generate', config: { sourceCode: '...', filePath: 'app.ts' } },
{ id: 'sec', type: 'scan-security', name: 'Security', config: { code: '...' } },
{ id: 'perf', type: 'analyze-performance', name: 'Performance', config: { code: '...' } },
],
triggers: [{ type: 'manual' }],
environment: {},
createdAt: new Date(),
updatedAt: new Date(),
});
// Health check
console.log(orchestrator.health());
// Shutdown
await orchestrator.shutdown();🤖 代理人(共13名)
| 代理 | 角色 | 关键能力 |
|---|---|---|
| 测试生成器 | 测试创建 | 生成包含边缘用例的全面测试套件 |
| TestRunner | 测试执行 | 运行测试,用AI解析输出 |
| Bug分析器 | 漏洞检测 | 深度静态分析,严重性评级 |
| 封面代理 | 覆盖率分析 | 间隙检测、阈值检查 |
| Review Agent | 代码审查 | 质量评分、问题分类 |
| 治疗剂 | 自我修复 | 对故障进行分类,建议自动修复 |
| 剧作家经纪人 | 浏览器自动化 | 基于人工智能的语义元素定位 |
| 担保代理人 | 安全扫描 | OWASP对齐漏洞检测 |
| PerformanceAgent | 性能分析 | 大O、N+1查询、内存泄漏 |
| 无障碍代理 | 全面检查 | WCAG 2.1 AA合规性 |
| ChaosAgent | 混沌工程 | 故障注入的弹性测试 |
| 突变剂 | 突变测试 | 通过代码突变来衡量测试质量 |
| 合同代理人 | 合同测试 | API合同验证(Pact-inspective) |
🔌 MCP工具(12个工具)
| 工具 | 说明 |
|---|---|
generate_tests | 为源代码生成全面的测试用例 |
run_tests | 执行测试并返回结构化结果 |
analyze_bugs | 对错误和漏洞进行深入的静态分析 |
review_code | 全面的代码审查和评分 |
analyze_coverage | 覆盖差距分析 |
query_knowledge | 在知识库中搜索模式 |
scan_security | OWASP安全扫描 |
check_dependencies | 易受攻击的依赖关系检测 |
design_chaos_experiment | 设计混沌工程场景 |
check_accessibility | WCAG合规性检查 |
analyze_performance | 性能问题检测 |
run_mutation_testing | 检测质量突变检测 |
📊 仪表盘
Next.js 15仪表板提供实时监控:
┌──────────────────────────────────────────────┐
│ Aurora QA ● Live │
├──────────┬───────────────────────────────────┤
│ │ [Runs: 142] [Pass: 94.2%] │
│ ◈ Dash │ [Bugs: 23] [Avg: 4.2s] │
│ ▶ Runs │ │
│ ⚙ Agent │ Agent Status (13 agents) │
│ 🪲 Bugs │ Recent Pipeline Runs │
│ │ Bug Tracker with Severity │
└──────────┴───────────────────────────────────┘pnpm dashboard # http://localhost:3001🔥 混沌工程
Aurora QA包括一个完整的混沌工程引擎:
- 网络延迟 --在接听电话时引入人为的延迟
- 网络故障 --网络请求随机失败
- CPU压力 --阻塞事件循环以模拟负载
- 记忆压力 --分配内存以测试GC行为
- 随机误差 --以可配置的概率注入错误
- 时间偏移 --偏移量
Date.now()用于临时测试
import { ChaosEngine } from '@aurora-qa/core';
const engine = new ChaosEngine();
engine.injectNetworkLatency(200, 0.5); // 200ms delay, 50% probability
engine.injectNetworkFailure(0.1); // 10% failure rate
// ... run your tests ...
engine.reset();🧠 智能层
- 事件记忆 --使用时间衰减评分存储和回忆过去的分析会话
- 模式库 --学习成功的测试模式并将其与新环境相匹配
- 工作记忆 --当前管道运行的短期背景
- 重新分配发动机 --复杂决策的思维链推理
- 测试优先级排序器 --基于变更接近度、故障历史和关键性的智能测试排序
⚙️ 配置
# Environment variables
ANTHROPIC_API_KEY=sk-ant-... # Required
AURORA_MODEL=claude-opus-4-6 # AI model (default: claude-opus-4-6)
DASHBOARD_PORT=3001 # Dashboard port
DASHBOARD_HOST=0.0.0.0 # Dashboard host
CORS_ORIGINS=http://localhost:3000📖 示例
| 示例 | 说明 |
|---|---|
basic-pipeline | 公用设施功能的完整质量保证管道 |
security-scan | 对易受攻击的代码进行安全扫描 |
chaos-resilience | 混沌工程实验 |
🤝 贡献
看 贡献.md 作为指导方针。
- 分叉存储库
- 创建特征分支:
git checkout -b feat/amazing-feature - 提交更改:
git commit -m 'feat: add amazing feature' - 推:
git push origin feat/amazing-feature - 打开拉取请求
📄 许可证
麻省理工学院——与❤️ 倪子健&奥罗拉🎀
