---
title: "Equivalence partitioning: telephone numbers"
subject: "Software Engineering"
chapter: 8
key: "semester_5/software_engineering:equivalence-partitioning"
source: https://www.bctengineer.com/q/semester_5/software_engineering/equivalence-partitioning
site: BCT Engineering
---

# Equivalence partitioning: telephone numbers

Software Engineering · Chapter 8: Software Testing and cost Estimation

- Asked in: 2069 Chaitra, 5 marks
- Video: [Software Testing tutorial- Equivalence partitioning in testing-Test Cases Design techniques in Hindi](https://www.youtube.com/watch?v=dllXf9IiHo8) — Fun Doo Testers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/equivalence-partitioning
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-8

## Question

What is Equivalence Partitioning? Explain with an example of checking for a telephone number (of a Country called Pumpkin Republic, which has 85 districts altogether) entry like 4422561263, where first two digits signify the number of district, third digit for either PSTN (1) or Cellular (2) and remaining digits are just numbers.

## Short answer

Equivalence partitioning divides inputs into valid and invalid classes expected to behave alike, testing one representative from each class. For a 10-digit Pumpkin Republic number: valid classes are 10 digits, all digits, district 01-85, and service digit 1 or 2; invalid classes cover wrong length, non-digits, district 00 or 86-99, and service 0 or 3-9.

## Answer

**Equivalence partitioning** is a black-box testing technique that divides the input domain into **equivalence classes**. All values in one class are expected to be handled the same way by the program, so one test value from each class is enough. Classes are made for **valid** and **invalid** inputs. This reduces the number of test cases while still covering the input domain.

#### Example: Pumpkin Republic telephone number

Format of 4422561263 (10 digits):
```text
  4 4   |   2    |  2 5 6 1 2 6 3
District| Service| Subscriber number
 (01-85)| 1=PSTN | (7 digits, 0-9)
        | 2=Cell |
```
**Assumptions:** exactly 10 digits; districts 1–9 written as 01–09; the last 7 digits may be any digits.

**Equivalence classes**

| Condition | Valid classes | Invalid classes |
|---|---|---|
| Length | V1: exactly 10 | I1: fewer than 10; I2: more than 10 |
| Characters | V2: all digits | I3: contains letter/symbol/space |
| District (digits 1–2) | V3: 01 to 85 | I4: 00; I5: 86 to 99 |
| Service (digit 3) | V4: 1 (PSTN); V5: 2 (Cellular) | I6: 0 or 3 to 9 |

**Test cases** (one invalid class per invalid test, so the cause of rejection is clear)

| No. | Input | Classes covered | Expected |
|---|---|---|---|
| 1 | 4422561263 | V1, V2, V3, V5 | Valid (cellular) |
| 2 | 4412561263 | V1, V2, V3, V4 | Valid (PSTN) |
| 3 | 442256126 | I1 | Invalid length |
| 4 | 44225612634 | I2 | Invalid length |
| 5 | 44225A1263 | I3 | Invalid character |
| 6 | 0012561263 | I4 | Invalid district |
| 7 | 9022561263 | I5 | Invalid district |
| 8 | 4452561263 | I6 | Invalid service code |

Adding boundary values of the district class (01, 85 valid; 00, 86 invalid), e.g. 0112345678, 8522345678 and 8612345678, makes the test set stronger.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is the idea of equivalence partitioning?
   A. Test every possible input
   B. Divide inputs into classes treated the same way, and test one value from each class
   C. Test only the boundaries
   D. Test only invalid inputs
   Answer: B. All values in a class are expected to behave alike, so one value per valid and invalid class reduces test cases. (Key point: Definition)

2. For the Pumpkin Republic number with 85 districts, which are the invalid district classes?
   A. 01 to 85
   B. 00 and 86 to 99
   C. 1 to 9
   D. Any digit 0-9
   Answer: B. Valid districts are 01 to 85, so 00 and 86 to 99 form the invalid classes. (Key point: District class)

3. Why does each invalid test case cover only one invalid class?
   A. To save paper
   B. So the cause of rejection is clear
   C. Because invalid inputs are not tested
   D. To make tests longer
   Answer: B. If several invalid conditions are combined, one error could mask another and the reason for rejection is unclear. (Key point: One invalid class per test)

4. Which value of the third digit is an invalid service code?
   A. 1
   B. 2
   C. 4
   D. Both 1 and 2
   Answer: C. Only 1 (PSTN) and 2 (cellular) are valid, so 0 and 3 to 9 are invalid. (Key point: Service digit)

## Related in other subjects

- [Poker test, 1000 four-digit numbers (2070 Magh)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2070-magh) — Simulation and Modeling, chapter 6, asked 3×
- [Poker test, 1000 four-digit numbers (2069)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2069-bhadra) — Simulation and Modeling, chapter 6, asked 3×
- [Poker test, 1000 four-digit numbers (2072 Magh)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2072-magh) — Simulation and Modeling, chapter 6
- [Sum of digits until single digit](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Adigit-sum-single-digit) — Computer Programming, chapter 5, asked 2×
