Skip to main content

Test Data Design Techniques with Examples

 

1. Equivalence Partitioning (EP)

What it is:
Divides input data into partitions of equivalent data from which test cases can be derived. The idea is that if one value in a partition works, all others will too.

Example:
If a form accepts ages from 18 to 60:

  • Valid partitions: 18–60
  • Invalid partitions: <18 and >60

Test cases:

  • One value from each partition: 25 (valid), 17 (invalid), 61 (invalid)

When to use:
When input data can be grouped into ranges or categories.


2. Boundary Value Analysis (BVA)

What it is:
Focuses on values at the edges (boundaries) of input ranges, where defects are most likely to occur.

Example:
For an input field that accepts values from 1 to 100:

  • Test boundaries: 0, 1, 2 and 99, 100, 101

Test cases:

  • 0 (just below), 1 (lower boundary), 2 (just above)
  • 99 (just below), 100 (upper boundary), 101 (just above)

When to use:
When input fields have defined minimum and maximum values.


  3. Decision Table Testing

What it is:
Uses a table to represent combinations of inputs and their corresponding outputs. Great for testing business rules.

Example:
A login form:

  • Rule: Login succeeds only if both username and password are correct.
Username Password Result
Valid Valid Success
Valid Invalid Failure
Invalid Valid Failure
Invalid Invalid Failure

When to use:
When the system behavior depends on multiple conditions or rules.


4. State Transition Testing

What it is:
Tests how the system behaves when transitioning from one state to another based on inputs/events.

Example:
ATM machine states:

  • Insert card → Enter PIN → Select transaction → Eject card

Test cases:

  • Valid transitions (e.g., correct PIN → access granted)
  • Invalid transitions (e.g., enter PIN without card)

When to use:
When the system has defined states and transitions (e.g., workflows, UI navigation).


5. Error Guessing

What it is:
Relies on tester experience to guess where defects are likely to occur.

Example:

  • Entering special characters in a name field
  • Submitting a form without required fields

When to use:
When you have domain knowledge or past experience with similar systems.


6. Pairwise Testing (All-Pairs Testing)

What it is:
Tests all possible discrete combinations of input pairs to reduce the number of test cases while maximizing coverage.

Example:
If you have 3 fields with 3 values each, instead of testing all 27 combinations, pairwise testing might reduce it to 9–10 combinations.

When to use:
When testing combinations of multiple input parameters.


🧠 Summary Table

Technique Best For Example Scenario
Equivalence Partitioning Grouped input ranges Age input: 18–60
Boundary Value Analysis Edge cases Salary input: 0–100,000
Decision Table Testing Business rules Loan approval logic
State Transition Workflow or UI state changes ATM or login flow
Error Guessing Common user errors Leaving fields blank, invalid formats
Pairwise Testing Input combinations Form with multiple dropdowns

🧪 What Is Pairwise Testing?

Pairwise testing ensures that every possible pair of input values is tested at least once. It’s especially useful when testing systems with multiple input parameters, where testing all combinations would be too time-consuming.


Real-World Example: Car Ordering Application

Let’s say you’re testing a car ordering system with the following input parameters:

Parameter Values
Order Category Buy, Sell
Location Delhi, Mumbai
Car Brand BMW, Audi, Mercedes
Registration Type Valid, Invalid
Order Type E-Booking, In-Store
Order Time Working Hours, Non-Working Hours

🔢 Total Combinations (Exhaustive Testing):

If you test all combinations:
2 × 2 × 3 × 2 × 2 × 2 = 96 test cases

That’s a lot!


Pairwise Testing Approach

With pairwise testing, you only test combinations that cover every possible pair of values at least once. This drastically reduces the number of test cases while still catching most defects caused by variable interactions.

🔁 Sample Pairwise Test Cases (Reduced Set):

Test Case Order Category Location Car Brand Registration Order Type Order Time
TC01 Buy Delhi BMW Valid E-Booking Working Hours
TC02 Sell Mumbai Audi Invalid In-Store Non-Working Hours
TC03 Buy Mumbai Mercedes Valid In-Store Working Hours
TC04 Sell Delhi BMW Invalid E-Booking Non-Working Hours
TC05 Buy Delhi Audi Valid In-Store Non-Working Hours
TC06 Sell Mumbai Mercedes Invalid E-Booking Working Hours

👉 These 6 test cases cover all possible pairs of input values, reducing the original 96 down to just a handful.


🎯 When to Use Pairwise Testing

  • When you have many input parameters with multiple values
  • When full combinatorial testing is impractical
  • When you want maximum coverage with minimal effort
Follow on LinkedIn

Comments

Popular posts from this blog

What is an SDET? – Roles, Responsibilities, and Career Path

Introduction The field of software testing has evolved significantly, and with the rise of automation, the Software Development Engineer in Test (SDET) role has become crucial. SDETs are technical testers with strong programming skills who ensure software quality through test automation and continuous integration. But what does an SDET really do? Let’s dive in.   Key Responsibilities of an SDET An SDET wears multiple hats—part developer, part tester, and part automation engineer. Their primary responsibilities include: Developing test automation frameworks for functional and regression testing. Writing automated test scripts to validate application functionality. Collaborating with developers to ensure testability of code. Implementing CI/CD pipelines with automated testing for continuous deployment. Conducting performance, security, and API testing to enhance software robustness. Required Skills for an SDET To excel as an SDET, you need a mix of technical and so...

Keys.RETURN vs Keys.ENTER in Selenium: Are They Really the Same?

When you're automating keyboard interactions with Selenium WebDriver, you're bound to encounter both Keys.RETURN and Keys.ENTER . At a glance, they might seem identical—and in many cases, they behave that way too. But under the hood, there’s a subtle, nerdy distinction that can make all the difference when fine-tuning your test scripts. In this post, we’ll break down these two key constants, when to use which, and why understanding the difference (even if minor) might give you an edge in crafting more accurate and resilient automation. 🎹 The Subtle Difference On a standard physical keyboard, there are typically two keys that look like Enter: Enter key on the numeric keypad. Return key on the main keyboard (near the letters). Historically: Keys.RETURN refers to the Return key . Keys.ENTER refers to the Enter key . That’s right—the distinction comes from old-school typewriters and legacy keyboard design. Return meant returning the carriage to the beginning ...

Regression Testing vs. Sanity Testing: Detailed Explanation with Example

  Regression testing and sanity testing are both essential software testing techniques, but they serve different purposes in ensuring software stability after modifications. Regression Testing Definition: Regression testing is a comprehensive testing approach that ensures recent code changes do not negatively impact the existing functionality of an application. It involves re-running previously executed test cases to verify that the software still works as expected after modifications such as bug fixes, feature additions, or updates. Key Characteristics: Scope: Covers the entire application. Purpose: Ensures that new changes do not break existing functionality. Execution Time: Time-consuming due to extensive testing. Test Cases: Uses a large set of test cases. Automation: Often automated for efficiency. Depth: In-depth testing of all functionalities. When Used: After major updates, bug fixes, or new features. ...