Software Testing Tutorial #35 - Boundary Value Analysis in Testing

Software Testing Mentor
10 Dec 202012:58

Summary

TLDRThis tutorial delves into Boundary Value Analysis (BVA), a critical software testing technique that complements Equivalence Partitioning (EP). The instructor uses a relatable house-building analogy to explain BVA, emphasizing the importance of testing at boundary values where software often fails. The tutorial demonstrates how to apply both techniques together to create effective test cases for maximum component coverage, highlighting their necessity for manual testers and those aspiring to excel in software testing.

Takeaways

  • πŸ˜€ Boundary Value Analysis (BVA) is a software testing technique that focuses on the boundaries of input ranges and values.
  • πŸ” BVA is often used in conjunction with Equivalence Partitioning (EP) to create comprehensive test cases.
  • 🏠 The script uses the analogy of building a house to explain BVA, emphasizing the importance of defining boundaries before constructing the 'house' or test cases.
  • πŸ“Š Equivalence Partitioning divides the input range into valid and invalid partitions to simplify testing by reducing the number of test cases needed.
  • πŸ“ˆ The tutorial provides a discount example to illustrate how to apply both EP and BVA to identify test cases with maximum coverage.
  • πŸ›‘ BVA is crucial for identifying potential failures at the boundaries of input ranges, where software components are more likely to fail due to calculation and logic errors.
  • πŸ“ The script explains how to determine the lower and upper boundary values for each partition and the importance of testing these values.
  • πŸ“‰ Invalid partitions, such as purchases below $1 or above $5001, are also considered in BVA to ensure the software handles these cases correctly.
  • πŸ”‘ The tutorial emphasizes the importance of testing both within and at the boundaries of valid partitions to achieve full test coverage.
  • πŸ“š Understanding BVA and EP is essential for manual testers and those looking to enter the field of software testing.
  • πŸ’Ό The concepts of BVA and EP are valuable for explaining test design techniques during interviews for software testing roles.

Q & A

  • What is Boundary Value Analysis (BVA)?

    -Boundary Value Analysis is a black box software testing technique that focuses on testing inputs at the boundaries of an input domain. It is often used in conjunction with Equivalence Partitioning (EP) to ensure maximum test coverage.

  • How does Boundary Value Analysis complement Equivalence Partitioning?

    -Equivalence Partitioning divides the input data into groups that are expected to behave similarly, while Boundary Value Analysis focuses on the edge values of these partitions. By combining both techniques, testers can ensure that both the normal and edge cases are thoroughly tested.

  • Can you provide an example of how to apply Boundary Value Analysis in a real-world scenario?

    -The script uses the example of building a house on a plot of land. Just as you define the boundaries of your land before construction, in BVA, you define the boundaries of input values and then test within those boundaries to ensure the software behaves as expected.

  • What is the significance of testing at boundary values in software testing?

    -Software components often fail at boundary values due to calculation and logic errors. Testing at these points helps identify potential issues that might not be caught with random testing within the range of valid inputs.

  • How does the script illustrate the concept of valid and invalid partitions in the context of a discount example?

    -The script uses a discount example where different discount rates apply based on the amount spent. Valid partitions are the ranges of spending that qualify for specific discounts, while invalid partitions are values outside these ranges, such as amounts less than $1 or more than $5001, which are not allowed to purchase.

  • What are the boundary values for the 5% discount partition in the given example?

    -For the 5% discount partition, the lower boundary value is $1.00, and the upper boundary value is $100.99, assuming the software does not round up to the next dollar.

  • How many boundary values are identified in the script for the discount example?

    -The script identifies 10 boundary values across different discount partitions, including both valid and invalid boundaries.

  • Why is it important to test values between the boundary values in addition to the boundaries themselves?

    -Testing values between boundary values ensures that the software behaves correctly within the entire range of valid inputs, not just at the edges. This helps achieve comprehensive test coverage and identify any potential issues that could arise within the input range.

  • What is the purpose of combining Equivalence Partitioning and Boundary Value Analysis in software testing?

    -Combining these two techniques helps create a structured approach to testing that covers both typical and edge case scenarios. This method reduces the chance of missing critical test cases and provides clarity in test case design.

  • How does understanding BVA and EP help someone get into a software testing job?

    -Understanding BVA and EP demonstrates knowledge of fundamental black box testing techniques, which are essential for manual testers and those looking to enter the field of software testing. Being able to explain and apply these concepts can make a candidate more attractive to potential employers.

Outlines

00:00

πŸ“˜ Introduction to Boundary Value Analysis (BVA)

The script introduces the concept of Boundary Value Analysis (BVA) in software testing, following up on the previous tutorial on Equivalence Partitioning (EP). It uses the same example of a discount system to demonstrate how to apply both EP and BVA together for effective test case design. The example involves a website offering different discounts based on the amount spent, with valid partitions for discounts and invalid partitions for purchases below $1 or above $5001. The script explains the importance of understanding both valid and invalid boundaries to ensure comprehensive testing of the software component.

05:01

πŸ—οΈ Applying BVA with Equivalence Partitioning

This paragraph delves into the practical application of Boundary Value Analysis in conjunction with Equivalence Partitioning. It uses an analogy of building a house on a plot of land to explain the concept of defining boundaries and then constructing within those boundaries. The script translates this analogy to software testing, where boundaries are identified for each partition, and test cases are designed accordingly. It discusses how to determine lower and higher boundary values for different discount rates, emphasizing the importance of testing at these boundary values due to the likelihood of software failures at these points.

10:02

πŸ” Importance of Boundary Value Analysis in Software Testing

The final paragraph emphasizes the significance of Boundary Value Analysis in identifying potential failures in software components, particularly at boundary values where calculations and logic are prone to errors. It outlines the process of selecting test cases that cover both boundary and in-between values within valid partitions, as well as invalid partitions, to ensure thorough testing. The script concludes by highlighting the benefits of using BVA and EP together for comprehensive test coverage and provides advice for those looking to enter the field of software testing, encouraging them to understand these techniques for better test design and job prospects.

Mindmap

Keywords

πŸ’‘Boundary Value Analysis (BVA)

Boundary Value Analysis is a black box testing design technique used to derive test cases. It focuses on the boundaries of input values or partitions, where software is more likely to fail. In the video, BVA is explained as a method to identify edge cases and is used in conjunction with Equivalence Partitioning to ensure comprehensive test coverage. The script uses the analogy of building a house to explain how defining boundaries is crucial for constructing test cases.

πŸ’‘Equivalence Partitioning (EP)

Equivalence Partitioning is another black box testing technique that divides the input data of a software system into groups of similar data from which test cases can be derived. The video emphasizes the importance of using EP to categorize the input data into valid and invalid partitions, which are then used alongside BVA to create effective test cases, as demonstrated with the discount example.

πŸ’‘Test Cases

Test cases are specific scenarios or sets of conditions under which a software system is tested to determine whether it behaves as expected. The script explains how to create test cases using BVA and EP by identifying boundary values and partitioning the input space, ensuring that the test cases cover all possible scenarios, including edge cases.

πŸ’‘Discount Example

The discount example in the script is a practical scenario used to illustrate the application of BVA and EP. It describes a situation where different discount percentages apply based on the amount spent, and the script shows how to partition the input values and identify boundary values to create test cases for maximum coverage.

πŸ’‘Boundary Values

Boundary values are the limits of the input ranges defined during BVA. They are critical points where errors are more likely to occur. The script explains how to identify lower and upper boundary values for each partition and how these values are used to create test cases that probe the software's response at its limits.

πŸ’‘Input Partitions

Input partitions are subsets of input data that are grouped based on equivalence criteria. In the context of the video, input partitions are created using EP, where the script discusses how to categorize purchase amounts into partitions that receive different discount rates, which are then used for BVA.

πŸ’‘Software Testing

Software testing is the process of evaluating a software system to detect any defects or to certify that it complies with specified requirements. The video is a tutorial on software testing techniques, specifically BVA and EP, and how they are essential for a tester to ensure the quality of software.

πŸ’‘Coverage

Coverage in the context of software testing refers to the extent to which the software's functionality is tested. The script emphasizes the importance of achieving maximum coverage by using BVA and EP to create test cases that explore all partitions and boundary values, thus reducing the likelihood of missing critical test scenarios.

πŸ’‘Black Box Testing

Black box testing is a method of software testing that focuses on the functionality of the software without considering the internal structure or code. The video discusses BVA and EP as black box techniques, which are used to design test cases based on the software's input and output behavior, as illustrated with the discount example.

πŸ’‘Invalid Partitions

Invalid partitions are groups of input data that do not meet the software's requirements and are expected to be rejected or handled in a specific way. The script uses the example of purchase amounts below one dollar and above 5001 dollars, which are defined as invalid partitions and are tested to ensure the software correctly handles these cases.

πŸ’‘Test Design Techniques

Test design techniques are methods used to create test cases that effectively evaluate the software. The video presents BVA and EP as essential test design techniques that, when used together, provide a structured approach to identifying and testing all relevant scenarios, including boundary conditions.

Highlights

Introduction to Boundary Value Analysis (BVA) in software testing.

The relationship between Equivalence Partitioning (EP) and BVA.

Using the same example from the previous tutorial to explain BVA.

Explanation of valid and invalid partitions in the context of a discount example.

How to apply EP and BVA together to create effective test cases.

The concept of partitioning discounts and purchase amounts in EP.

The analogy of building a house to explain the concept of BVA.

Defining boundaries for test cases in software testing, similar to land boundaries for a house.

The process of identifying boundary values within equivalence partitions.

Importance of testing boundary values due to higher failure rates at these points.

How to derive test cases from boundary values and partitions.

The significance of not rounding values in certain software modules.

Detailed explanation of boundary values for different discount percentages.

The approach to design test cases with predefined values for maximum coverage.

Advantages of using EP and BVA over random testing for software components.

The necessity of testing both boundary and in-between values for comprehensive coverage.

Practical application of BVA and EP in manual testing and software testing interviews.

Encouragement for viewers to ask questions for further clarification.

Transcripts

play00:00

hello everyone welcome again in the

play00:03

software testing tutorial

play00:04

we are going to understand what is

play00:07

boundary value analysis

play00:09

so in the last tutorial we have

play00:11

understood about equivalence

play00:12

partitioning or

play00:13

ep in short now we will understand about

play00:16

bva

play00:17

or boundary value analysis equivalence

play00:19

partitioning and boundary value

play00:21

analysis go hand in hand so i'll

play00:23

continue with the same example

play00:25

that i explained in the last tutorial

play00:28

and i'll show you

play00:29

how you can apply equivalence

play00:31

partitioning and boundary value analysis

play00:33

together

play00:34

to come up with the best test cases to

play00:36

get the maximum coverage for the

play00:38

component

play00:39

that you are going to test all right so

play00:42

this is the discount

play00:43

example that we have took in the last

play00:46

tutorial

play00:47

so these you know were the four valid

play00:50

partition so i'll just write valid

play00:57

and here it is invalid above 5001

play01:00

should be not allowed to purchase right

play01:03

so these are the discount purchases

play01:05

that a particular website uh is offering

play01:08

and we are say for example going to test

play01:10

it so in equivalence partitioning what

play01:13

we have done is we have partitioned

play01:15

the discounts uh

play01:18

and the amount that need to be purchased

play01:21

in a particular partition right so for

play01:23

example up to 100

play01:25

from one two hundred dollars the

play01:26

discount percentage should be five

play01:28

percent

play01:29

hundred and one to two hundred dollars

play01:30

should be ten percent right

play01:32

so this is what we have done to divide

play01:35

the discount percentage into equivalence

play01:38

partitions

play01:40

and then we had invalid partition

play01:42

because anything less than point

play01:44

less than one dollar should should not

play01:45

be allowed to purchase

play01:47

and anything above five thousand one

play01:48

dollar should shouldn't be

play01:50

you know allowed uh the purchase

play01:52

shouldn't be allowed in that case

play01:54

so now if we talk about the boundary

play01:57

value analysis

play01:59

i'll come up with the example of the

play02:02

boundary so

play02:03

very raw example say for example

play02:06

you are let me remove this as of now

play02:09

i'll make it again

play02:11

say for example you are building a house

play02:14

okay

play02:15

now when you are building a house you

play02:16

have a piece of land

play02:19

and the piece of land will have the

play02:22

length and

play02:23

breadth okay so this is length and this

play02:27

is breadth

play02:28

right so usually you know this is say

play02:30

for example your frontage and say for

play02:32

example this is of 10 meters

play02:34

and this is of 20 meters depth okay

play02:37

now when you're building the house you

play02:38

basically first thing you do

play02:40

is you see the map and you

play02:44

define the boundaries of your

play02:47

land or the piece of land that you have

play02:48

bought to build the house right

play02:50

so in this case you will say okay this

play02:53

is you know this is my

play02:55

you know boundary on the map 0 to 10

play02:57

meters

play02:58

okay this is what my frontage is and

play03:01

then you know again from here

play03:03

0 to 20 meter this is my depth is and

play03:06

you define

play03:06

the boundary once you define the

play03:09

boundary of your

play03:10

piece of land then you start you know

play03:12

you you

play03:13

have the boundary build and usually you

play03:16

then you know define

play03:18

all the plan and you start building your

play03:20

house within that boundary

play03:22

so boundary value analysis is no

play03:24

different from what this example is

play03:28

we have the boundaries so we define the

play03:30

boundaries

play03:31

and then within those boundaries what we

play03:34

can do

play03:35

as part of you know defining the test

play03:36

cases we

play03:38

define those test cases so in case of

play03:40

building the house we define the

play03:42

boundaries and then we build the house

play03:44

okay we build house we build rooms

play03:47

everything within the boundary

play03:48

and in terms of boundary value analysis

play03:50

and software we define the boundaries

play03:53

and then we come up with the test cases

play03:56

within those boundaries okay

play03:59

so as part of equivalence partitioning

play04:02

we have already defined

play04:06

you know the partitions or

play04:09

plots in this case or the piece of land

play04:11

that everyone is going to build

play04:13

okay say for example this is the

play04:15

partition

play04:16

i'll explain this with the same analogy

play04:20

so this is say for example my plot this

play04:22

is my niche's plot

play04:24

say this is somebody else's so say ram's

play04:27

plot

play04:28

this is shiva's plot

play04:32

okay and

play04:35

this is for example tony's plot

play04:39

right so now i know my plots boundary so

play04:43

what i know is i know that this boundary

play04:46

or

play04:46

this plot or this partition

play04:49

is mine and this partition is valid from

play04:53

0 from 1 200 right so when we talk about

play04:57

e-commerce thing

play04:58

we have the values that are accepted in

play05:01

this particular

play05:02

partition so one dollar is what i should

play05:05

be starting with

play05:07

and up to say for example 100 or

play05:09

whatever the end boundary

play05:11

is i should be testing

play05:14

this partition with those boundary okay

play05:17

so first thing is in boundary value

play05:19

analysis to

play05:20

analyze the partition that you have done

play05:22

in equivalence partition and get the

play05:24

boundaries

play05:24

okay so in this case the lower boundary

play05:28

will be 100 uh one dollar okay

play05:31

so we'll be starting with the lower

play05:32

boundary as we have

play05:34

understood in the plot example that if

play05:37

the frontage is

play05:38

10 meters so i'll start from 0 to 10

play05:40

meters and i'll mark that

play05:42

and then i'll go depth and start with

play05:44

that so in this

play05:45

five percent discount thing one dollar

play05:48

is the

play05:48

lower boundary and then

play05:52

if say for example this particular

play05:54

software or this particular module

play05:56

accepts up to two decimal places and

play05:59

doesn't

play05:59

round those values so for example it

play06:02

accepts 100.99

play06:04

and doesn't round 0.99 to 101

play06:07

okay it doesn't do that then the highest

play06:11

boundary

play06:12

of the purchase should be 100.99

play06:16

okay so 100.99

play06:20

is what the highest purchase amount

play06:23

should be in this particular partition

play06:26

that should still

play06:27

be applicable for five percent discount

play06:30

because as soon as

play06:32

this changes to 101 dollar

play06:35

right as soon as this changes to 101

play06:38

dollar

play06:38

this becomes the boundary lower boundary

play06:42

of 10 percent discount

play06:43

okay so that's how you analyze each of

play06:46

the equivalence partition

play06:48

and get the boundary values so in this

play06:51

case the lower boundary value is 101

play06:53

the higher boundary value is 200.99

play06:59

because we have already you know assumed

play07:01

that 0.99 is not getting rounded

play07:04

to one dollar okay so this should still

play07:06

be applicable

play07:07

for 10 discount so we are getting the

play07:10

lower boundary the higher boundary

play07:12

same case as we had in the plot lower

play07:15

boundary higher boundary for length and

play07:17

breadth so that we can define

play07:19

our plot and start building the house so

play07:22

we are here we are defining

play07:24

the lower boundary and higher boundary

play07:26

so that

play07:27

we can define what our boundaries are

play07:30

what

play07:30

this particular partitions boundary are

play07:34

so that we can pick the values and start

play07:37

defining which values we are going to

play07:39

use in our test cases

play07:41

okay here in the 20

play07:44

discount the lower boundary is 201

play07:48

and the higher boundary is again 500.99

play07:53

in the 25 percent it is 501

play07:56

the lower boundary and the higher

play07:58

boundary is

play08:01

5000.99

play08:03

okay and then 5001

play08:07

as soon as it reaches 5001 purchase

play08:09

amount it is again

play08:10

invalid purchase amount and it shouldn't

play08:13

be allowed

play08:14

or customer shouldn't be allowed to

play08:16

purchase or make the purchase of that

play08:18

particular amount right so you can

play08:21

consider here that these are you know

play08:22

sort of plots that we have

play08:24

understood in the plot analogy and then

play08:27

come up with the lower and higher

play08:30

boundaries

play08:31

and then design your test case so let me

play08:35

move this and

play08:38

now here in the invalid

play08:42

lower invalid boundary we have this 0.99

play08:45

anyways okay so now we have got these

play08:48

equivalence partition which is we have

play08:50

understood in the previous tutorial so

play08:52

we have partitioned these discount

play08:55

based on the values that are accepted in

play08:57

the partitions

play08:58

and we have also got the boundary so we

play09:00

have got the boundary of 0.99

play09:03

then we have got the boundary lower

play09:04

boundary of five percent discount which

play09:06

is one dollar

play09:07

then 100.99 then 101

play09:11

200.99 then

play09:13

201 500.99

play09:17

501 and 5000.99

play09:22

right and then 5001

play09:26

as soon as a person wants to purchase 5

play09:29

000 one dollar

play09:30

amount or want to spend on that

play09:32

particular website it shouldn't

play09:34

allow that right so now if you see

play09:38

that instead of doing the random testing

play09:41

when we use equivalence partition and

play09:43

boundary value analysis together

play09:46

we have come up with very predefined

play09:49

test cases or the data that we use that

play09:52

we need to use in our test cases from

play09:54

each of the partitions along with the

play09:57

boundary values

play09:58

right why do we need to do the boundary

play10:02

value analysis and testing because

play10:04

the software components most of the time

play10:08

you know because of the calculation and

play10:10

logic

play10:11

they are they tend to fail more at the

play10:14

boundary values

play10:15

okay so it is very necessary that we

play10:18

test the

play10:20

value in between along with all the

play10:22

boundary values of the valid and invalid

play10:24

partitions

play10:25

okay so that is why now we have the

play10:28

partitions so we can easily come up with

play10:31

1 2 3 4 5 6 7

play10:34

8 9 10 boundary values so we'll use

play10:37

these

play10:38

as our test cases okay along with

play10:42

some values between these

play10:45

valid partitions right so for example

play10:48

you pick

play10:48

one or two values from one two hundred

play10:51

so you can pick you know ten dollars you

play10:53

can pick

play10:53

seventy dollars it will still be

play10:55

considered as five percent discount

play10:57

you pick one or two values from each of

play11:00

these partitions

play11:01

even if you pick just one should still

play11:03

be fine and then pick all the boundary

play11:05

values

play11:06

and that is what will be required

play11:10

to give you a complete coverage of

play11:13

this particular component right so

play11:16

rather than doing

play11:17

random pick and choose and you know

play11:20

start doing testing from one dollar to

play11:22

50 to

play11:23

you know 150 and then 200 and not

play11:26

knowing the partitions and boundary

play11:29

it's better to design your test cases

play11:32

do the equivalence partition do the

play11:34

boundary value analysis

play11:36

and then use these values in

play11:39

your test case or design your test case

play11:41

which will give you a lot better

play11:43

coverage

play11:44

and clarity in terms of defining the

play11:46

test cases and there will be very

play11:48

minimal chance of

play11:49

missing any of the boundary values or

play11:52

equivalence partitions okay

play11:55

so that is all for this particular

play11:58

tutorial

play11:58

on boundary value analysis boundary

play12:00

value analysis goes hand in hand with

play12:03

equivalence partition

play12:04

so you have to apply both together to

play12:07

get the

play12:08

maximum benefit and these are the two

play12:11

test design black box test design

play12:13

techniques that

play12:14

are must for you to understand

play12:18

uh in terms of you know manual tester or

play12:22

person who wants to get into software

play12:23

testing and even in terms of

play12:26

understanding and explaining to any

play12:29

software testing interviewer

play12:30

okay so if you explain all these

play12:33

concepts with these sort of examples

play12:35

and understand these in detail you will

play12:38

be definitely be able to get into

play12:39

software testing job very easily

play12:42

so hope this was helpful and clear if

play12:45

you want

play12:46

you know any more detail or you have any

play12:49

queries please do comment in the comment

play12:51

section below

play12:52

and i'll get back to you so that's all

play12:55

for this tutorial

play12:56

thank you very much for watching

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Software TestingBoundary ValuesEquivalence PartitioningTest DesignQuality AssuranceTest CasesE-CommerceDiscount AnalysisTutorialEducational