Test-driven Development
테스트 주도 개발
테스트 주도 개발(TDD)은 세 가지 단계를 반복합니다. 작은 실패 테스트를 작성합니다. 통과하는 최소한의 코드를 작성합니다. 그런 다음 동작을 변경하지 않고 코드를 정리합니다.
다른 예시
개발자는 실패하는 하나의 예제 테스트로 새로운 금액 반올림 규칙을 시작합니다. 가장 작은 코드로 테스트를 통과시키고, 이후 반복된 코드를 정리하면서 모든 테스트가 통과 상태를 유지합니다. 코드 작성 후에만 작성된 테스트도 유용하지만, 그것은 TDD의 테스트 우선 사이클이 아닙니다.
주요 부분
- 01실패 예시
- 02최소 통과 코드
- 03안전한 리팩터링
사용할 때
다음 설계 단계가 실패한 테스트에 의해 주도되고 안전한 정리로 이어질 때 이 용어를 사용하세요.
다음 경우에는 사용하지 마세요
프로젝트에 테스트가 많다고 해서 TDD라고 부르지 마십시오. 코드는 반드시 테스트-퍼스트 루프를 따라야 합니다.
코드에서 사용된 이름
red → green → refactor 출시하기 전에
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-driven Development)。 User context:개발자는 실패하는 하나의 예제 테스트로 새로운 금액 반올림 규칙을 시작합니다. 가장 작은 코드로 테스트를 통과시키고, 이후 반복된 코드를 정리하면서 모든 테스트가 통과 상태를 유지합니다. 코드 작성 후에만 작성된 테스트도 유용하지만, 그것은 TDD의 테스트 우선 사이클이 아닙니다. Validation approach:테스트 주도 개발 (Test-driven Development)。 Why it fits:다음 설계 단계가 실패한 테스트에 의해 주도되고 안전한 정리로 이어질 때 이 용어를 사용하세요. Do not use it when:프로젝트에 테스트가 많다고 해서 TDD라고 부르지 마십시오. 코드는 반드시 테스트-퍼스트 루프를 따라야 합니다. 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-driven Development) is used now. Definition: 테스트 주도 개발(TDD)은 세 가지 단계를 반복합니다. 작은 실패 테스트를 작성합니다. 통과하는 최소한의 코드를 작성합니다. 그런 다음 동작을 변경하지 않고 코드를 정리합니다. 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.