# Boundary Value Analysis & Equivalence Partitioning with Examples

16/10/2023

Boundary Testing is a software testing technique that focuses on the boundaries of input domains. It is based on the idea that many errors in software systems occur at or near the boundaries of acceptable input values, rather than in the middle of the input range.

Boundary Testing working:

1. Identify Input Ranges: Determine the valid ranges of input values for a particular function or feature of the software.
2. Select Boundary Values: Choose values that are just inside and just outside of the defined ranges. These values are often referred to as boundary values.
3. Create Test Cases: Design test cases using these boundary values. Test cases should cover the minimum, maximum, and critical values at the boundaries.
4. Execute Tests: Execute the test cases using the selected boundary values.

The goal of Boundary Testing is to ensure that the software behaves correctly at the edges of valid input ranges. This is important because software systems can sometimes exhibit unexpected behavior when processing values near the limits of what they can handle.

For example, consider a system that accepts input values between 1 and 10. The boundary test cases would include:

• Test with 0 (just below the minimum boundary).
• Test with 1 (the minimum boundary).
• Test with 5 (a middle value).
• Test with 10 (the maximum boundary).
• Test with 11 (just above the maximum boundary).

By conducting Boundary Testing, testers aim to uncover potential issues related to boundary conditions, such as off-by-one errors, boundary checks, and other edge case scenarios. This technique is applicable to a wide range of software applications and is commonly used in both manual and automated testing.

Equivalence Partitioning

Equivalence Partitioning is a software testing technique that divides the input space of a program into groups or partitions of equivalent data. The primary objective of this technique is to reduce the number of test cases while maintaining adequate coverage.

Equivalence Partitioning working:

1. Identify Input Classes: Group the possible inputs into different classes or partitions based on their characteristics.
2. Select a Representative Value: Choose a representative value from each partition. This value is considered equivalent to all other values in the same partition.
3. Generate Test Cases: Use the representative values to create test cases. Each test case represents a partition.
4. Execute Tests: Execute the generated test cases, ensuring that the system behaves consistently within each partition.

The underlying principle of Equivalence Partitioning is that if one test case in an equivalence class passes, it is highly likely that all other test cases in the same class will also pass. Similarly, if one test case fails, it is likely that all other test cases in the same class will fail.

For example, if a system accepts ages between 18 and 60, the equivalence classes would be:

• Class 1: Ages less than 18 (Invalid)
• Class 2: Ages between 18 and 60 (Valid)
• Class 3: Ages greater than 60 (Invalid)

Test cases would then be selected from each class, such as:

• Test with age = 17 (Class 1, Invalid)
• Test with age = 30 (Class 2, Valid)
• Test with age = 65 (Class 3, Invalid)

Equivalence Partitioning is a powerful technique for reducing the number of test cases needed while still providing good coverage. It is particularly useful for situations where exhaustive testing is impractical due to time and resource constraints. Equivalence Partitioning is commonly used in both manual and automated testing.

Why Equivalence & Boundary Analysis Testing?

Equivalence Partitioning and Boundary Analysis Testing are essential software testing techniques that serve distinct but complementary purposes in the testing process:

Equivalence Partitioning:

Purpose:

Equivalence Partitioning helps reduce the number of test cases needed to cover a wide range of scenarios. It focuses on grouping input values into classes or partitions, with the assumption that if one value in a partition behaves a certain way, all other values in the same partition will behave similarly.

• Reduces redundancy: Testers do not need to test every individual value within a partition, saving time and effort.
• Enhances test coverage: By selecting representative values from each partition, a broad range of scenarios is still covered.
• Identifies common issues: Equivalence Partitioning is effective at uncovering issues related to input validation and handling.

Example:

In testing a login system, if valid usernames are categorized into “valid usernames” and “invalid usernames,” testers can focus on testing representative values within each partition.

Boundary Analysis Testing:

Purpose:

Boundary Analysis Testing aims to examine the behavior of a system at or near the boundaries of acceptable input values. It helps identify potential issues related to boundary conditions.

• Reveals edge cases: Testing at boundaries helps uncover off-by-one errors, array index problems, and other boundary-related issues.
• Focuses on critical scenarios: It targets the most critical values that often have a significant impact on system behavior.
• Enhances robustness: Ensures that the software can handle values near the limits of what it is designed to accept.

Example:

In testing a system that accepts values between 1 and 10, boundary test cases would include tests with values like 0, 1, 5, 10, and 11.

Why Both Techniques?

These techniques complement each other by addressing different aspects of testing. While Equivalence Partitioning reduces the number of test cases needed, focusing on representative values, Boundary Analysis Testing ensures that the software handles critical boundary conditions effectively. By employing both techniques, testers can achieve a balanced and comprehensive testing approach, enhancing the overall quality and reliability of the software.

Disclaimer: This article is provided for informational purposes only, based on publicly available knowledge. It is not a substitute for professional advice, consultation, or medical treatment. Readers are strongly advised to seek guidance from qualified professionals, advisors, or healthcare practitioners for any specific concerns or conditions. The content on intactone.com is presented as general information and is provided “as is,” without any warranties or guarantees. Users assume all risks associated with its use, and we disclaim any liability for any damages that may occur as a result.