Boundary Value Analysis with Real-life Examples

Boundary Value Analysis with Real-life Examples

6 mins read1.8K Views Comment
Updated on May 18, 2023 15:57 IST

This article covers Boundary Value Analysis with its working. Real-Life example are also covered. It also covers the advantages/disadvantages of Boundary Value Analysis.

2023_05_MicrosoftTeams-image-5.jpg

Boundary value analysis is a black-box testing technique that helps test whether an application’s output falls within the acceptable range for all input values. It focuses on testing edge or boundary conditions, including extreme and invalid values. It identifies errors or imperfections in input parameter boundary conditions. BVA is a key testing technique that helps identify and fix bugs early in the software development lifecycle (SDLC). This article describes the basics of marginal analysis, its benefits, and how to perform marginal analysis tests effectively.

Table of contents

Recommended online courses

Best-suited Quality Assurance & Testing courses for you

Learn Quality Assurance & Testing with these high-rated online courses

â‚ą2.67 L
2 years
– / –
60 hours
â‚ą38 K
6 months
â‚ą74.5 K
40 hours
– / –
– / –

What is Boundary Value Analysis?

Boundary Value Analysis (BVA) is a black-box testing technique that involves testing the boundaries of input parameters in a software application.

Boundary value analysis involves software testing data near the specified limits or boundaries in the input specification. The aim is to test the input data’s extreme values and boundary conditions. This includes:

• Minimum and maximum values – Test inputs at or near the defined minimum and maximum limits. 

• Default values – Test default values when no input is provided.

• Edge values – Test inputs right on the boundaries or edges.

• Invalid values – Test invalid inputs to check for proper error handling. 

2023_05_2-2.jpg

For doing boundary value analysis only boundary values will be taken like minimum value x(min), x(min-1),x(max+1) and x(max).This means we will check our software working by giving these values. We will not take values in-between them.

Basic principle: The basic principle of BVA is to choose values ​​above or below the limits of the input parameters to test the software application. This is because software applications most likely fail at the limits of their input parameters.

Must explore: Difference between Black box and White box testing

Also read: What Does A Software Engineer Do? Roles, Responsibilities, and Skills

Also read: A Day in Life of a Software Engineer – An Interview Log

Real-life example of boundary value analysis

Example 1

Consider a software application that requires users to enter the age. Applications may contain specific minimum and maximum age restrictions. The restriction is to enter the age between 18 to 30 years. If the user enters values ​​above 30 or below 18, the application may not work as expected. In this scenario, you can use BVA to test your application by choosing values ​​equal to, above, or below the age limit.

Invalid case Valid case Invalid case
11.12.13.,14,15,16,17 21,22,23,24,25,26,27,28,29 31,32,33,34,35,36,37,38,39

Example 2

Let us assume there is a test case that takes the car speed from 40 km/hr- 80 km/hr, and if the speed is lower than 40 and higher than 80, then our software should send the notification. To test our software’s working, we will pick boundary values like 40,41,79,80. We will check our software performance on these boundary values. If the values are entered below 40 and above 80 then it will be considered invalid case. If the value entered is between 40-80 then it will be a valid case.

Boundary Value Test Case
Invalid Test Case
(Min Value-1)
Valid Test Case
(Min,+Min,Max,-Max)
Invalid Test Case
(Max Value+1)
39 40,41,79,80 81
White Box Testing with Real Life Example
White Box Testing with Real Life Example
White-box testing techniques analyze internal structures, data structures used, internal design, code structure, and software behavior. This article includes white box testing with real life scenarios based examples. It also...read more
Manual Testing in software engineering
Manual Testing in software engineering
Manual testing is software testing in which test cases are executed manually by testers without using any automated tool. Manual testing identifies bugs, problems, and defects in software applications. For...read more
Software Testing Life Cycle
Software Testing Life Cycle
STLC(Software Testing Life Cycle) is a sequence of steps being followed while doing software testing.This article will explain you different phases of testing life cycle with example and in a...read more

Also explore: Black Box Testing Online Courses & Certifications

Also explore: Automation Testing Online Courses & Certifications

Why Boundary Value Analysis

  • This test is used to reduce a very large number of test cases into manageable chunks.
  • Suitable for computationally intensive applications with many variables/inputs
  • Boundary value testing is a crucial step in software testing that helps ensure the reliability and accuracy of an application. 
  • This testing technique focuses on the values at the limits or edges of acceptable ranges for input parameters, providing comprehensive coverage where bugs might exist by selecting inputs from inside and outside these limits.
  • Identifying defects that could be missed if only tests were performed using typical values is possible. For example, a program designed to handle positive integers may not be able to handle negative integers; boundary value testing ensures that such anomalies are identified and corrected before the final product release.

How does Boundary Value Analysis work?

To perform boundary value analysis, you first need to identify the boundaries and limits of the input data. Then you determine test cases that target:

It first identifies the minimum and maximum values for each input field and then selects test cases that focus on these boundary values. Let’s take the same above example of speed detection software. This software will notify if the speed is below 40 km/hr and more than 80 km/hr. The process involves several steps: 

  1. First, the inputs are identified for each application function or feature. In this case, the input will be speed.
  2. Next, each input’s minimum and maximum boundary values are established based on the requirements document or functional specifications. The minimum value set will be 40 km/hr, and the maximum value will be 80 km/hr.
  3. Test cases are selected that examine values at the minimum, just below it, in between them, just above it and at the maximum range of acceptable input values. The following cases will be there.
  • The speed value is exactly 40 km/hr (minimum boundary value)
  • A value that is just below 40 km/hr
  • A value that is between 40 and 80 km/hr
  • A value that is just below 80 km/hr
  • A value that is exactly 80 km/hr (maximum boundary value)

4. The selected test cases are executed by entering the input values into the login page and attempting to log in.

5. Test results are analyzed to identify any bugs or errors in software functionality. Boundary value analysis can help reduce costly debugging time later in the development process by highlighting potential issues when changes may be easier to make and less disruptive.

Explore popular Software Testing Courses

Advantages of Boundary Value Analysis

1. Using BVA reduces the number of test cases required to cover the input domain by only testing a few values ​​at each boundary instead of all possible ones. This saves time and resources and makes test cases more manageable and maintainable. 

2. BVA can also help you find deviation errors error, overflow errors, or boundary condition errors that you would otherwise miss. This overall improves software quality.

3. BVA can find bugs that can affect application functionality, performance, or security, thus improving the quality and reliability of your software.

4. BVA ensures that the software can process the input values ​​correctly.

5. Errors can be detected early in the software development cycle. This reduces the cost of fixing errors later.

Disadvantages of Boundary Value Analysis

1. The success of testing using this technique depends on the equivalence classes identified. This also depends on the tester’s experience and application knowledge. Thus, incorrect identification of equivalence classes leads to incorrect limit testing. Equivalence classes refer to a software testing technique where input data is divided into groups or sets that are expected to exhibit similar behavior in the software system being tested. Each group is known as an equivalence class

2. Applications with open or missing one-dimensional boundaries are unsuitable for this technique. Other black-box techniques, such as “domain analysis”, are used in such cases.

3. BVA may fail to identify defects that occur within the boundaries themselves. This can lead to false negatives and prevent developers from detecting important bugs early in development. 

4. BVA may be effective at identifying potential edge cases, testing all possible boundary values in a given system may not be practical or feasible in every case.

Conclusion

Boundary value analysis (BVA) is a powerful software testing technique that helps identify errors in the limits of input variables. By thoroughly testing critical values, BVA improves software quality, reduces the required test cases, finds bugs early in the software development cycle, and provides comprehensive coverage. Involving his BVA in the software testing process improves the quality and efficiency of software development and ultimately leads to higher customer satisfaction. Therefore, BVA should be considered an essential software testing methodology to ensure software applications’ reliability, efficiency and effectiveness.

About the Author

This is a collection of insightful articles from domain experts in the fields of Cloud Computing, DevOps, AWS, Data Science, Machine Learning, AI, and Natural Language Processing. The range of topics caters to upski... Read Full Bio