ISTQB 연습문제 풀이 - Exam D : Q#20

Equivalence Partitioning for Discount Type (Exam D – Question 20)

1. Introduction

In the ISTQB Foundation Level exam, equivalence partitioning (EP) helps you reduce the number of test cases while still achieving good coverage.

This question asks you to add test data to achieve full valid equivalence partition coverage for the discount type.

ISTQB에서 동등 분할(Equivalence Partitioning)은 적은 테스트로도 충분한 커버리지를 확보하기 위한 대표적인 기법입니다.

이 문제는 할인 유형에 대해 유효 동등 분할(Valid EP)을 모두 커버하도록 추가 테스트 데이터를 고르는 문제입니다.


2. Practice Question

❓ Question

The system for selling cinema tickets calculates the discount type based on birth year (BY) and current year (CY):

Let D = CY – BY

  • If D < 0 → print error message: “birth year cannot be greater than current year”
  • If 0 ≤ D < 18 → apply the student discount
  • If 18 ≤ D < 65 → apply no discount
  • If D ≥ 65 → apply the pensioner discount

Your test suite already contains:

  • BY = 1990, CY = 2020 → expected: no discount
  • BY = 2030, CY = 2029 → expected: error message

Which test data sets should be added to achieve full valid equivalence partitioning coverage for the discount type? (Select TWO)

  • a) BY = 2001, CY = 2065
  • b) BY = 1900, CY = 1965
  • c) BY = 1965, CY = 1900
  • d) BY = 2011, CY = 2029
  • e) BY = 2000, CY = 2000

✅ Correct Answers: b) and e)


3. Explanation

Step 1: Identify the equivalence partitions

  • Invalid: D < 0 → error message
  • Valid: 0 ≤ D < 18 → student discount
  • Valid: 18 ≤ D < 65 → no discount
  • Valid: D ≥ 65 → pensioner discount

Already covered:

  • BY 1990, CY 2020 → D = 30 → no discount (valid partition)
  • BY 2030, CY 2029 → D = -1 → error (invalid partition)

So, the missing valid partitions are:

  • student discount (0 ≤ D < 18)
  • pensioner discount (D ≥ 65)

이미 포함된 테스트는 “무할인(18~65 미만)”과 “오류(D<0)”입니다. 따라서 아직 커버되지 않은 유효 동등 분할학생 할인연금(노인) 할인입니다.


✔ b) BY = 1900, CY = 1965 — Correct (Pensioner discount)

D = 1965 - 1900 = 65 → D ≥ 65

This covers the pensioner discount partition, which is missing.

D = 65 이므로 연금 할인(노인 할인) 구간을 커버합니다.


✔ e) BY = 2000, CY = 2000 — Correct (Student discount)

D = 2000 - 2000 = 0 → 0 ≤ D < 18

This covers the student discount partition, which is missing.

D = 0 이므로 학생 할인 구간(0~18 미만)을 커버합니다.


Why the other options are incorrect

❌ a) BY = 2001, CY = 2065

D = 2065 - 2001 = 64 → 18 ≤ D < 65 → no discount (already covered)

❌ c) BY = 1965, CY = 1900

D = 1900 - 1965 = -65 → D < 0 → error (already covered)

❌ d) BY = 2011, CY = 2029

D = 2029 - 2011 = 18 → 18 ≤ D < 65 → no discount (already covered)

a, c, d는 이미 커버된 구간(무할인 또는 오류)에 해당하므로 추가할 필요가 없습니다.


4. Summary Table

Option D = CY - BY Partition Needed for Full Valid EP? 결론
a 64 No discount ✖ No 이미 커버
b 65 Pensioner discount ✔ Yes 추가 필요
c -65 Error ✖ No 이미 커버
d 18 No discount ✖ No 이미 커버
e 0 Student discount ✔ Yes 추가 필요

5. Final Takeaway

For the ISTQB exam, remember:

Full valid equivalence partition coverage means one test for each valid partition. Here, the missing partitions are student discount and pensioner discount.

시험 대비 핵심 문장입니다.

유효 동등 분할 커버리지는 유효 구간마다 최소 1개의 테스트를 의미한다. 이 문제에서 부족한 구간은 학생 할인과 연금 할인이다.

Related: More ISTQB Posts | Next Question

다음 이전