Open
Conversation
a41a000 to
a9112d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Issue
✍️ Summary
BDD 구조 테스트 작성
가독성을 위해 계층 구조는 2~3단계를 유지하였습니다.
Top Level (클래스): 테스트 대상 (예: OrderServiceTest)
1단계 (Nested 클래스): 테스트할 행위
2단계 (Nested 클래스): 행위가 일어나는 상황/조건
3단계 (메서드): 기대하는 결과/상태
주문 생성 테스트 ->
주문 조회 테스트 ->
📢 Notify
아직 주문 생성 테스트 코드는 작성 X
BDD 테스트 코드 작성 시 계층 나누기 팁
Describe-Context-It 패턴: BDD의 정석 패턴
BDD 테스트의 단점은 무엇이 있을까?
코드양의 증가
메서드 하나를 테스트하려 해도 실제 검증 로직보다 구조를 잡기 위한 코드가 더 많아질 수 있음
깊은 계층 구조로 인한 인지 과부하
3~4 단계의 계층 구조만 되어도 테스트의 맥락을 잃기가 쉬움, 상위 조건(@beforeeach)을 지속적으로 확인해야함
상위 계층 의존성
@beforeeach에서 공통 데이터를 준비할 때 발생
상위 계층의 조건 수정 시 하위 계층 모두에 영향을 끼쳐 유지보수가 어려워질 수 있음