Skip to content

무료배송 기준 금액 경계 조건 수정 - #1

Closed
wlrnjs wants to merge 2 commits into
mainfrom
fix/free-shipping-threshold
Closed

wlrnjs wants to merge 2 commits into
mainfrom
fix/free-shipping-threshold

Conversation

@wlrnjs

@wlrnjs wlrnjs commented Sep 20, 2026

Copy link
Copy Markdown
Member

무엇을

calculateShipping 의 무료배송 조건을 > 에서 >= 로 고칩니다.

왜

README 의 금액 정책은 "주문 금액이 50,000원 이상이면 무료배송" 입니다.
그런데 구현은 이렇게 되어 있었습니다.

if (subtotal > FREE_SHIPPING_THRESHOLD) {
  return 0;
}

이 때문에 주문 금액이 정확히 50,000원일 때 무료배송이 적용되지 않고
배송비 3,000원이 그대로 붙었습니다. 딱 기준선에 맞춰 장바구니를 담은
사용자만 손해를 보는, 눈에 잘 안 띄는 경계값 버그입니다.

어떻게

조건을 >= 로 바꿨습니다. 한 글자 수정입니다.

검증

수정 전에는 경계값 테스트 2건이 실패했습니다.

  • calculateShipping — 기준 금액과 정확히 같으면 무료배송이다
  • calculateTotal — 상품 금액이 무료배송 기준과 같으면 배송비가 붙지 않는다
수정 전: tests 10 / pass 8 / fail 2
수정 후: tests 10 / pass 10 / fail 0

이 PR 은 Dante 데모용으로 만든 테스트 PR 입니다.

Generated with Claude Code

무료배송 조건이 `subtotal > 50000` 으로 되어 있어 주문 금액이
정확히 50,000원일 때 배송비 3,000원이 그대로 붙었다.
정책은 "50,000원 이상 무료배송" 이므로 `>=` 로 고친다.

경계값 테스트 2건이 실패하고 있었고, 이 수정으로 10건 모두 통과한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wlrnjs
wlrnjs force-pushed the fix/free-shipping-threshold branch from e79e9e7 to af80bc9 Compare September 20, 2026 12:03
Dante 연결 이전에 열린 PR 이라 이벤트를 받지 못했다.
동작 확인을 위해 빈 커밋으로 PR 이벤트를 발생시킨다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wlrnjs
wlrnjs force-pushed the fix/free-shipping-threshold branch from 42f36e8 to 87379a0 Compare September 20, 2026 12:12
@wlrnjs wlrnjs closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant