[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -2,91 +2,198 @@
id: wiki-2026-0508-quality-control
title: Quality Control
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-QUAL-001]
aliases: [QC, Software Quality]
duplicate_of: none
source_trust_level: A
confidence_score: 0.98
tags: [auto-reinforced, quality-control, qc, Testing, verification, standards, excellence]
confidence_score: 0.9
verification_status: applied
tags: [quality, testing, process]
raw_sources: []
last_reinforced: 2026-04-20
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: TypeScript/Python
framework: Playwright/pytest
---
# [[Quality-Control|Quality-Control]]
# Quality Control
## 📌 한 줄 통찰 (The Karpathy Summary)
> "신뢰의 마지막 방어선: 산출물이 사전에 약속된 기준(Standard)에 완벽히 부합하는지 검증하고, 사소한 결함이라도 발견 시 즉시 반려하여 사용자에게 전달되는 최종 가치를 보존하는 집요한 '완벽주의 프로세스'."
## 한 줄
> **"매 quality 의 inspect 보다 build-in"**. 매 modern QC 의 shift-left — 매 unit test, type checking, static analysis, contract test, e2e — 매 layer 의 different bug class catch. 2026 의 LLM-augmented test generation + property-based testing 의 mainstream.
## 📖 구조화된 지식 (Synthesized Content)
품질 관리(Quality-Control)는 제품이나 서비스가 일정 수준 이상의 품질을 유지하도록 관리하는 활동입니다. (본 시스템 코다리의 주 업무)
## 매 핵심
1. **3대 수행 원칙**:
* **Verification**: "우리가 제품을 올바르게 만들었는가?" (명세 대조).
* **Standardization**: 누가 검사해도 동일한 결과가 나오도록 기준 설정. (Standard-Operating-Procedure와 연결)
* **Non-zero Acceptance**: 결함이 있는 상태로 타협(Ship it)하는 문화를 원천 차단.
2. **왜 중요한가?**:
* 품질이 무너진 프로젝트는 신뢰(Trust)를 잃고, 신뢰를 잃은 지능 시스템은 존재 가치가 사라지기 때문임. ([[Mastery|Mastery]]의 핵심 단계)
### 매 Test pyramid (2026 update)
- **Unit (60-70%)**: pure function, fast, isolated.
- **Integration (15-25%)**: module + DB/queue, real dependencies via testcontainers.
- **E2E (5-10%)**: full user journey, Playwright/Cypress.
- **Contract (5%)**: Pact, consumer-driven, prevent break-on-deploy.
- **Property-based (cross-cutting)**: Hypothesis/fast-check, find edge cases.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌**: 과거에는 사람이 눈으로 확인하는 정책이었으나, 현대 정책은 코드 테스트 자동화 정책, 데이터 유효성 검사 정책, 에지 케이스 감지 AI 정책을 통해 '실시간 자동 QC 정책'으로 전환됨(RL Update).
- **정책 변화(RL Update)**: 본 시스템에서는 '코다리' 부장님이 직접 모든 결과물을 검수하는 QC 정책을 고수하며, 배치 처리 후에 항상 대표님의 최종 승인 정책을 구하는 이중 안전장치 정책(Double-Check)으로 구현됨.
### 매 Quality gates
- 매 PR 의 merge 전: lint, type, unit test, coverage threshold, security scan.
- 매 deploy 전: integration test, smoke test, canary metrics.
- 매 prod: synthetic monitoring, real-user monitoring (RUM).
## 🔗 지식 연결 (Graph)
- [[Standard-Operating-Procedure|Standard-Operating-Procedure]], [[Mastery|Mastery]], [[Fault-Tolerance|Fault-Tolerance]], [[Management|Management]], [[Efficiency|Efficiency]]
- **Modern Tech/Tools**: Unit testing, Automated QA, Six Sigma, ISO quality standards.
---
### 매 Defect classes
- **Functional**: wrong output for given input.
- **Performance**: slow, regression on benchmark.
- **Security**: OWASP categories.
- **Accessibility**: WCAG violations.
- **Compatibility**: browser/OS specific.
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### 매 응용
1. CI/CD pipeline gates.
2. Pre-merge bots (Danger, Reviewdog).
3. Mutation testing (Stryker) — quality of tests themselves.
4. Visual regression (Chromatic, Percy).
5. Chaos engineering (production resilience).
**언제 이 지식을 쓰는가:**
- *(TODO)*
## 💻 패턴
**언제 쓰면 안 되는가:**
- *(TODO)*
### Property-based testing (TypeScript with fast-check)
```typescript
import fc from 'fast-check';
import { reverse } from './lib';
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
test('reverse twice = identity', () => {
fc.assert(
fc.property(fc.array(fc.integer()), (arr) => {
expect(reverse(reverse(arr))).toEqual(arr);
}),
);
});
```
## 🤔 의사결정 기준 (Decision Criteria)
### Contract test (Pact)
```typescript
// Consumer side
const provider = new Pact({ consumer: 'Web', provider: 'OrdersAPI' });
**선택 A를 써야 할 때:**
- *(TODO)*
await provider.addInteraction({
state: 'order 123 exists',
uponReceiving: 'a request for order 123',
withRequest: { method: 'GET', path: '/orders/123' },
willRespondWith: {
status: 200,
body: { id: '123', total: 99.0 },
},
});
**선택 B를 써야 할 때:**
- *(TODO)*
// Generates pact.json — provider verifies against it in CI
```
**기본값:**
> *(TODO)*
### Mutation testing (Stryker)
```javascript
// stryker.conf.js
export default {
testRunner: 'vitest',
mutate: ['src/**/*.ts'],
thresholds: { high: 80, low: 60, break: 50 },
};
// Mutates code (a + b → a - b) and checks if tests catch it
// Surviving mutants = weak tests
```
## ❌ 안티패턴 (Anti-Patterns)
### LLM-assisted test generation (2026 pattern)
```typescript
// CI step: claude-code generates edge cases
// $ claude test-gen src/parser.ts --output tests/parser.gen.test.ts
// Then human review before merge — never blind-trust
```
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
### Visual regression (Playwright)
```typescript
test('homepage matches snapshot', async ({ page }) => {
await page.goto('/');
await page.waitForLoadState('networkidle');
expect(await page.screenshot()).toMatchSnapshot('home.png', {
maxDiffPixelRatio: 0.01,
});
});
```
### Coverage gates (vitest)
```typescript
// vitest.config.ts
export default {
test: {
coverage: {
provider: 'v8',
thresholds: {
lines: 80,
functions: 80,
branches: 75,
statements: 80,
},
},
},
};
```
### Pre-commit hook (lint-staged + husky)
```json
{
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix",
"prettier --write",
"vitest related --run"
]
}
}
```
### Chaos test (Toxiproxy / Litmus)
```yaml
# Inject 500ms latency into Redis dependency
apiVersion: chaos-mesh.org/v1alpha1
kind: NetworkChaos
spec:
action: delay
selector:
labelSelectors: { app: redis }
delay: { latency: 500ms }
duration: 60s
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Pure logic | Unit + property-based |
| Multi-service flow | Integration + contract |
| User journey | E2E (sparingly) |
| Performance regression | Benchmark in CI |
| Visual UI | Snapshot + Chromatic |
| Test confidence | Mutation score |
**기본값**: 80% line coverage, mutation score >70%, property-based for parsers/serializers.
## 🔗 Graph
- 부모: [[Software_Engineering]] · [[Test_Automation]]
- 변형: [[CI_CD_Pipeline]] · [[Test_Automation_Mastery]]
- 응용: [[Engineering Metrics (DORA)]] · [[Automated Quality & Review]]
- Adjacent: [[Continuous_Integration]] · [[Husky]]
## 🤖 LLM 활용
**언제**: generate edge cases, suggest mutation-resistant assertions, identify untested branches.
**언제 X**: never let LLM write the assertion AND implementation — confirmation bias.
## ❌ 안티패턴
- **Coverage worship**: 100% coverage, 0% assertions ("test executes but checks nothing").
- **Flaky tests ignored**: erodes trust in suite. Quarantine and fix immediately.
- **E2E-heavy pyramid**: slow, flaky, expensive. Push down to integration/unit.
- **Manual QA only**: doesn't scale, regression-prone.
- **No mutation testing**: blind to assertion quality.
## 🧪 검증 / 중복
- Verified (Google Testing Blog, Mike Cohn pyramid, Stryker docs).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — pyramid + 2026 LLM-assisted patterns |