d3ro-voice/docs/tdd-red/metrics/2026-11-08.md
Yun Chan 42583cc96b test(infra): add test-system metrics baseline (TDD 2.0 Phase 0)
docs/tdd-red/07-revamp-plan.md Phase 0 — "측정 없는 개편은 없다"의 첫 단계.
게이트가 아니라 지표다 (05 §9: 커버리지·강도는 지표, 완료 조건 아님).

추가:
- scripts/ci/test-metrics.mjs — 스위트별 파일/케이스/단정/약한 단정/ambient/스킵,
  i18n 로케일 수·키 수를 markdown 또는 JSON 으로 산출 (--write 로 날짜 문서 생성)
- scripts/ci/lib/test-files.mjs — 테스트 파일 판정·계수 공용 헬퍼
  (test:hygiene 과 같은 패턴을 쓰도록 한 곳에 모음)
- docs/tdd-red/metrics/2026-11-08.md — 오늘 기준선

측정 결과 (기준선):
- 파일 407 · 케이스 3,498 · 단정 8,958
- 약한 단정(toBeDefined/toBeTruthy/toBeFalsy/toBeNull) 128
- ambient 시계/난수(Date.now/Math.random/performance.now) 203
- skip/todo 3 · i18n 2,753키 × 12로케일

문서:
- 07-revamp-plan.md: 상태를 "Phase 0 완료"로 갱신, 측정치를 추정치(3,380/106/169)에서
  실측치로 교정
- REFACTOR_WAVE5_AUDIT.md: Wave 5 감사 결과(실행 입력) 편입

검증: node scripts/ci/test-metrics.mjs --write / --json GREEN,
      npm run test:metrics GREEN
2026-11-08 21:08:35 +09:00

70 lines
3.2 KiB
Markdown

# 테스트 체계 지표 — 2026-11-08
> `node scripts/ci/test-metrics.mjs --write` 로 생성된다. 손으로 고치지 않는다.
> 정책: `docs/tdd-red/07-revamp-plan.md` §3-2 (지표는 게이트가 아니다)
## 합계
| 항목 | 값 |
|---|---|
| 테스트 파일 | 407 |
| 테스트 케이스 | 3498 |
| 단정(expect/assert) | 8958 |
| 약한 단정 (toBeDefined/toBeTruthy/toBeFalsy/toBeNull) | 128 |
| 시간·난수 직접 호출 (ambient) | 203 |
| skip/todo | 3 |
| i18n 로케일 파일 | 12 |
| i18n 키 (ko 기준) | 2753 |
## 스위트별
| 스위트 | 파일 | 케이스 | 단정 | 약한 단정 | ambient |
|---|---:|---:|---:|---:|---:|
| 데스크톱 (Vitest) | 212 | 2075 | 5148 | 88 | 164 |
| packages/core (Vitest) | 36 | 547 | 1239 | 14 | 3 |
| packages/api-client (Vitest) | 4 | 31 | 47 | 3 | 0 |
| 웹 (Vitest + Playwright) | 8 | 46 | 203 | 9 | 5 |
| 모바일 (Jest) | 95 | 509 | 1595 | 14 | 24 |
| Supabase Edge (Deno) | 44 | 263 | 637 | 0 | 7 |
| Cloudflare Worker (Deno) | 1 | 5 | 22 | 0 | 0 |
| API 서버 (xUnit) | 7 | 22 | 67 | 0 | 0 |
## 약한 단정 상위 파일
| 파일 | 개수 |
|---|---:|
| `packages/core/__tests__/keybinding.test.ts` | 10 |
| `apps/mobile-rn/__tests__/auth-privacy-boundary.test.tsx` | 9 |
| `apps/desktop/tests/main/services/input-telemetry-stale-snapshot.test.ts` | 8 |
| `apps/web/e2e/dashboard-dictionary-commands.spec.ts` | 7 |
| `apps/desktop/tests/unit/stt-model-download-redteam-r3-24.test.ts` | 6 |
| `apps/desktop/tests/main/sync/cloud-credentials-redteam-r3-1.test.ts` | 5 |
| `apps/desktop/tests/red/history.usecase.test.ts` | 5 |
| `apps/desktop/tests/red/ads/ads-mediation.test.ts` | 4 |
| `apps/desktop/tests/main/services/CustomInstructionService.test.ts` | 3 |
| `apps/desktop/tests/unit/AdMediationEngine.test.ts` | 3 |
| `packages/core/__tests__/typo-correction.test.ts` | 3 |
| `apps/desktop/tests/main/services/DictionaryService.test.ts` | 2 |
| `apps/desktop/tests/main/services/HistoryService.test.ts` | 2 |
| `apps/desktop/tests/main/services/KeyBindingService.test.ts` | 2 |
| `apps/desktop/tests/main/services/i18n-locale-parity.test.ts` | 2 |
## ambient 시간·난수 상위 파일
| 파일 | 개수 |
|---|---:|
| `apps/desktop/tests/main/services/suggestion-redteam-r1-1.test.ts` | 11 |
| `apps/desktop/tests/integration/cross-device-sync.supabase.test.ts` | 10 |
| `apps/desktop/tests/main/sync/SyncEngine.test.ts` | 10 |
| `apps/desktop/tests/red/crypto-license.usecase.test.ts` | 8 |
| `server/supabase/functions/_shared/admob-ssv.test.ts` | 7 |
| `apps/desktop/tests/main/services/input-flow-services.test.ts` | 6 |
| `apps/desktop/tests/main/services/modifier-state.test.ts` | 6 |
| `apps/desktop/tests/main/services/suggestion-redteam-r2-3.test.ts` | 6 |
| `apps/desktop/tests/main/services/suggestion-redteam-r3-1.test.ts` | 6 |
| `apps/desktop/tests/red/meeting-recording-redteam-r2-1.test.ts` | 6 |
| `apps/mobile-rn/__tests__/templates-memos.local.integration.mjs` | 6 |
| `apps/desktop/tests/main/services/input-telemetry-focus-flicker.test.ts` | 5 |
| `apps/mobile-rn/__tests__/admin-mobile.local.e2e.mjs` | 5 |
| `apps/desktop/tests/eval/suggestion-replay.eval.test.ts` | 4 |
| `apps/desktop/tests/main/services/KeyBindingService.test.ts` | 4 |