Unit Test
단위 테스트
단위 테스트는 소프트웨어의 작은 부분 하나를 자체적으로 검사합니다. 느리거나 신뢰할 수 없는 외부 시스템은 테스트에서 제외됩니다.
다른 예시
개발자는 세금 테이블과 여러 예제 값을 사용하여 가격 함수를 테스트합니다. 총액은 네트워크나 데이터베이스를 시작하지 않고 정확해야 합니다. 전체 서비스를 시작하고 실제 데이터베이스를 사용하는 테스트는 단위 테스트가 아닙니다.
주요 부분
- 01테스트 대상 단위
- 02제어된 종속성
- 03포커스된 단언
사용할 때
통제된 종속성을 가진 한 가지 행동을 빠르게 로컬에서 확인할 때 이 용어를 사용하십시오.
다음 경우에는 사용하지 마세요
테스트가 확인해야 하는 동작을 속이지 마세요. 단위 테스트는 전체 시스템이 함께 작동하는지를 증명할 수 없습니다.
코드에서 사용된 이름
arrange → act → assert 출시하기 전에
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 단위 테스트 (Unit Test)。 User context:개발자는 세금 테이블과 여러 예제 값을 사용하여 가격 함수를 테스트합니다. 총액은 네트워크나 데이터베이스를 시작하지 않고 정확해야 합니다. 전체 서비스를 시작하고 실제 데이터베이스를 사용하는 테스트는 단위 테스트가 아닙니다. Validation approach:단위 테스트 (Unit Test)。 Why it fits:통제된 종속성을 가진 한 가지 행동을 빠르게 로컬에서 확인할 때 이 용어를 사용하십시오. Do not use it when:테스트가 확인해야 하는 동작을 속이지 마세요. 단위 테스트는 전체 시스템이 함께 작동하는지를 증명할 수 없습니다. 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 단위 테스트 (Unit Test) is used now. Definition: 단위 테스트는 소프트웨어의 작은 부분 하나를 자체적으로 검사합니다. 느리거나 신뢰할 수 없는 외부 시스템은 테스트에서 제외됩니다. 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.