mcpField
Q
qe-defect-intelligence

qe-defect-intelligence

github.com/proffesor-for-testingテスト・品質51994 回インストール今日更新
リポジトリ

qe-defect-intelligence について

qe-defect-intelligenceは、欠陥リスクの予測や過去のパターン学習、根本原因の調査を支援するテストスキルです。変更内容の分析と体系的なRCA手法を組み合わせます。

主な機能

  1. 01コード変更に基づく欠陥予測
  2. 02過去の欠陥パターン学習
  3. 03複数の根本原因分析手法
  4. 04リスクスコアと要因の提示
  5. 05課題トラッカーとの同期

活用シーン

  1. 01リスクの高いプルリクエストのレビュー優先度付け
  2. 02繰り返し発生する失敗パターンの発見
  3. 03テスト失敗の原因調査

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/proffesor-for-testing/agentic-qe --skill qe-defect-intelligence

インストール後、Claude Code で/qe-defect-intelligenceを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

evals/
qe-defect-intelligence.yaml
schemas/
output.json
scripts/
validate-config.json

詳細

QE 欠陥インテリジェンス

目的

ML ベースの欠陥予測、過去のデータからのパターン認識、自動化された根本原因分析など、v3 の欠陥インテリジェンス機能の使用方法を説明します。

有効化するタイミング

  • 欠陥が発生しやすいコードを予測するとき
  • 障害パターンを分析するとき
  • 根本原因分析を実施するとき
  • 過去の欠陥から学習するとき
  • リスクに基づいてテストの優先順位を決めるとき

クイックスタート

# Predict defects in changed code
aqe defect predict --changes HEAD~5..HEAD

# Analyze failure patterns
aqe defect patterns --period 90d --min-occurrences 3

# Root cause analysis
aqe defect rca --failure "test/auth.test.ts:45"

# Learn from resolved defects
aqe defect learn --source jira --status resolved

エージェントのワークフロー

// Defect prediction
Task("Predict defect-prone code", `
  Analyze PR #456 changes and predict defect likelihood:
  - Historical defect correlation
  - Code complexity factors
  - Author experience with module
  - Test coverage gaps
  Flag high-risk changes requiring extra review.
`, "qe-defect-predictor")

// Root cause analysis
Task("Analyze test failure", `
  Investigate recurring failure in AuthService tests:
  - Collect failure history (last 30 days)
  - Identify common patterns
  - Trace to potential root causes
  - Suggest fixes using 5-whys analysis
`, "qe-root-cause-analyzer")

予測モデル

1. 変更ベースの予測
await defectPredictor.predictFromChanges({
  changes: prChanges,
  factors: {
    codeChurn: { weight: 0.2 },
    complexity: { weight: 0.25 },
    authorExperience: { weight: 0.15 },
    fileHistory: { weight: 0.2 },
    testCoverage: { weight: 0.2 }
  },
  threshold: {
    high: 0.7,
    medium: 0.4,
    low: 0.2
  }
});
2. パターン学習
await patternLearner.learnPatterns({
  source: {
    defects: 'jira:project=MYAPP&type=bug',
    commits: 'git:last-6-months',
    tests: 'test-results:last-1000-runs'
  },
  patterns: [
    'code-smell-to-defect',
    'change-coupling',
    'test-gap-correlation',
    'complexity-defect-density'
  ],
  output: {
    rules: true,
    visualizations: true,
    recommendations: true
  }
});
3. 根本原因分析
await rootCauseAnalyzer.analyze({
  failure: testFailure,
  methods: [
    'five-whys',
    'fishbone-diagram',
    'fault-tree',
    'change-impact'
  ],
  context: {
    recentChanges: true,
    environmentDiff: true,
    dependencyChanges: true,
    similarFailures: true
  }
});

欠陥予測レポート

interface DefectPrediction {
  file: string;
  riskScore: number;  // 0-1
  riskLevel: 'critical' | 'high' | 'medium' | 'low';
  factors: {
    name: string;
    contribution: number;
    details: string;
  }[];
  historicalDefects: {
    count: number;
    recent: Defect[];
    patterns: string[];
  };
  recommendations: {
    action: string;
    priority: string;
    expectedRiskReduction: number;
  }[];
}

パターンのカテゴリ

パターン検出方法防止策
Null ポインター静的解析Null チェック、Optional
競合状態並行性解析ロック、アトミック操作
メモリーリークヒープ解析リソースのクリーンアップ
オフバイワンエラー境界解析ループ不変条件
インジェクション汚染解析入力検証

根本原因分析テンプレート

root_cause_analysis:
  five_whys:
    max_depth: 5
    prompt_template: "Why did {effect} happen?"

  fishbone:
    categories:
      - people
      - process
      - tools
      - environment
      - materials
      - measurement

  fault_tree:
    top_event: "Test Failure"
    gate_types: [AND, OR, NOT]
    basic_events: true

課題追跡との統合

await defectIntelligence.syncWithTracker({
  source: 'jira',
  project: 'MYAPP',
  sync: {
    defectData: 'bidirectional',
    predictions: 'create-tasks',
    patterns: 'update-labels'
  },
  automation: {
    flagHighRisk: true,
    suggestAssignee: true,
    linkRelated: true
  }
});

連携

主要エージェント: qe-defect-predictor、qe-pattern-learner、qe-root-cause-analyzer コーディネーター: qe-defect-intelligence-coordinator 関連スキル: qe-coverage-analysis、qe-quality-assessment

コメント