Fundamentals 6 min read

How to Eliminate Duplicate Test Cases with Equivalence Partitioning and Boundary Value Analysis

The article explains how to identify and remove redundant test cases by applying equivalence class partitioning and boundary value analysis, using a concrete account‑management example to reduce 28 generated cases down to 18 while preserving full coverage.

FunTester
FunTester
FunTester
How to Eliminate Duplicate Test Cases with Equivalence Partitioning and Boundary Value Analysis

Background

After writing test cases, testers often discover many duplicate cases, leading to wasted effort. This duplication is especially common when test cases are created using equivalence class partitioning and boundary value analysis.

Example Scenario

Consider a backend that maintains front‑end user accounts with three fields (only three are shown for brevity):

Account: 4‑8 alphanumeric characters

Password: 8‑16 alphanumeric characters

Name: 4‑20 characters consisting of letters, digits, special symbols, and Chinese characters

We analyze the equivalence classes and boundary values for each field.

Account Field

Valid equivalence classes: 6‑character alphanumeric, 5‑digit only, 7‑letter only.

Invalid equivalence classes: 3‑character, 9‑character, Chinese characters, empty.

Boundary values: 4 characters, 8 characters.

Password Field

Valid equivalence classes: 9‑character alphanumeric, 10‑digit only, 11‑letter only.

Invalid equivalence classes: 7‑character, 17‑character, Chinese characters, empty.

Boundary values: 8 characters, 16 characters.

Name Field

Valid equivalence classes: mixed letters/digits/special/Chinese (length 10), letters only (length 11), digits only (length 12), special symbols only (length 13), Chinese only (length 14).

Invalid equivalence classes: length 3, length 21, empty.

Boundary values: length 4, length 10.

Using only equivalence class partitioning and boundary analysis yields 28 test cases.

Identifying Redundancy

During execution, many cases overlap. For example, testing the account field with a 6‑digit input while the other two fields use any valid equivalence class repeats work when later testing the password field.

The key is to list all possible inputs in a single column and then combine them according to specific rules.

Combination Principles

One test case may contain multiple valid equivalence classes, and all of them must be valid.

Only one invalid equivalence class is allowed per test case, and the valid classes in that case cannot be used as verification conditions.

Valid and invalid equivalence classes must never be validated together.

Applying the Rules

Mark which equivalence classes can be combined; identical numbers indicate they can be covered in the same test case. Cases 1‑5 can each cover several valid classes, while cases 6 and 7 contain extra valid classes for the remaining fields.

Since the other two fields already cover all their valid classes, cases 8‑18 consist solely of invalid equivalence classes and must be tested separately.

Result

After applying the combination principles, the total number of test cases drops from 28 to 18, eliminating redundancy while maintaining full coverage.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Software Testingtest case designtest optimizationboundary value analysisequivalence partitioningduplicate reduction
FunTester
Written by

FunTester

10k followers, 1k articles | completely useless

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.