Test Double
테스트 더블
Test Double은 진짜 시스템 부품 대신 서는 거야. Stub, fake, spy, mock이 통제나 관측을 도와줘.
다른 예시
배송 테스트는 요금이 정해진 가짜 배송사를 써. 스파이(spy)는 통과된 주문이 수거를 딱 한 번 예약하는지 확인해.
주요 부분
- 01Code or behavior under test
- 02Observable evidence
- 03Coverage, failure, and recovery
사용할 때
경계를 안정시키거나 중요한 계약을 드러내는 가장 간단한 쌍을 선택하세요.
다음 경우에는 사용하지 마세요
자신의 호출 그래프를 모킹(mock)하지 마세요, 의존성 버그를 복사하지 마세요, 소중한 통합 테스트를 대체하지 마세요.
코드에서 사용된 이름
stub / fake / spy / mock 출시하기 전에
Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule.
Outcome:Complete the task with 테스트 더블 (Test Double)。 User context:배송 테스트는 요금이 정해진 가짜 배송사를 써. 스파이(spy)는 통과된 주문이 수거를 딱 한 번 예약하는지 확인해. Validation approach:테스트 더블 (Test Double)。 Why it fits:경계를 안정시키거나 중요한 계약을 드러내는 가장 간단한 쌍을 선택하세요. Do not use it when:자신의 호출 그래프를 모킹(mock)하지 마세요, 의존성 버그를 복사하지 마세요, 소중한 통합 테스트를 대체하지 마세요. Test requirements: Name the system and test environment. Define prepared test data, other inputs, and the result you can observe. Include failure and edge cases, allowed error, isolation, and cleanup. Test operations: Make failures easy to diagnose. Control random or changing inputs. Name an owner. Keep the test fast and simple enough for its release gate. Acceptance criteria: The test fails for the known bug and passes after the fix. It repeats in the target environment, gives useful evidence, and does not expose or change unrelated data. Evidence and limits (evidence boundary):하나의 공식 표준이 전체 용어를 통제하지 않음. 의미는 팀, 플랫폼 또는 프레임워크마다 달라질 수 있음. Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
이 요청을 확인하세요
Review how 테스트 더블 (Test Double) is used now. Definition: Test Double은 진짜 시스템 부품 대신 서는 거야. Stub, fake, spy, mock이 통제나 관측을 도와줘. Release checks: Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.