0% found this document useful (0 votes)
92 views17 pages

Boundary Value Analysis

Boundary value testing involves generating test cases that target the extreme points and boundaries of input values. For a program that calculates the average age based on multiple age inputs: 1. Five test cases would be generated for a single input field, targeting the minimum, just above minimum, nominal, just below maximum, and maximum values. 2. For two independent input fields like age and education years, nine test cases would cover the boundaries by varying one field while holding the other constant. 3. Robustness testing expands the boundaries to include invalid and unexpected inputs, requiring seven test cases per field to cover all outlier situations.

Uploaded by

Sri Venigandla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views17 pages

Boundary Value Analysis

Boundary value testing involves generating test cases that target the extreme points and boundaries of input values. For a program that calculates the average age based on multiple age inputs: 1. Five test cases would be generated for a single input field, targeting the minimum, just above minimum, nominal, just below maximum, and maximum values. 2. For two independent input fields like age and education years, nine test cases would cover the boundaries by varying one field while holding the other constant. 3. Robustness testing expands the boundaries to include invalid and unexpected inputs, requiring seven test cases per field to cover all outlier situations.

Uploaded by

Sri Venigandla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Testing Input Fields with

Boundary Value Technique

Boundary Value Testing


A type of Black box functional testing
The program takes inputs and maps some out-puts
The internal of the program itself is not considered

A technique to generate test cases via considering


(mostly) the inputs to the program
The rationale for this focus is that there are
experiences from the past which indicate that errors
tend occur at the extreme points.
Input data (legal versus illegal)
Loop iteration (beginning and ending of loops)
Output fields (legal versus illegal)

A simple example
Consider a program that reads the age of
each person here and computes the average
age of the people.

input (s) Program output: average age


How would you test this?
How many test cases would you generate?
What type of test data would you input to test this
program?

Input (s) to Program Average


First question would be - - - how many input data?
The answer is some number 1 or more --- not too sure, yet.

Second question would be --- what value should each


input age be?
Try some typical age such as 23 or 45
Try some atypical age 125 or 700
How about trying a wrong age of -5 or 0 or @

When we try the atypical age or some wrong age, we


may discover that the program may not handle or
process properly ---- possibly resulting in a failure.
Failure in this case, may include strange answer, but
not necessarily program termination.

Example: Program Age Average


Inputs composed of only typical ages: 23, 67, 97
Look at the output average, and the average is
computed either
Correctly
Incorrectly

Inputs composed of atypical or wrong ages


What is an atypical or wrong age?
Let us cap the age from 1 to 150.
So the lower and upper boundaries for age is 1 and
150, respectively.

Boundaries of the inputs

1 <=
1

age

<= 150

age

150

The basic boundary value testing would include 5 situations:


1. - at minimum boundary
2. - immediately above minimum
3. - between minimum and maximum (nominal)
4. - immediately below maximum
5. - at maximum boundary

The Test Cases for this Example


Howe many test cases for this example ?
answer for this one field : 5

What types of test input values? :


1
2
45
149
150

at the minimum
at one above minimum
at middle
at one below maximum
at maximum

Single fault or independent faults


For the previous problem, there was 1 input field.
Suppose there are 2 distinct inputs that are assumed
to be independent (single fault) of each other.
Input field 1: years of education ( say 1 to 23 )
Input field 2: age

If they are independent of each other, then we can start


with looking at 5 + 5 = 10 sets, but wont need all 10 of
them.
coverage of input data: yrs of ed

coverage of input data: age

1.
2.
3.
4.
5.

1.
2.
3.
4.
5.

n= 1 ;
n =2;
n = 12;
n = 22;
n = 23;

age = whatever(37)
age = whatever
age = whatever
age = whatever
age = whatever

n= 12;
n =12;
n = 12;
n = 12;
n = 12;

age = 1
age = 2
age = 37
age = 149
age = 150

2 independent inputs
age

yrs of ed.
- Note that there needs to be only 9 test cases for 2 independent
variables or inputs.
- In general, there will be (4z + 1) test cases for z independent inputs.

Some Limitations of Boundary Value Testing


What would we do with boolean variables?
True
False
(these may not be input fields but radio buttons)

What about non-numerical variable where the


values may be text?

Robustness testing

This is just an extension of the Boundary


Values to include:
Less than minimum
Greater than maximum

There are 7 cases or values to worry about for


each independent variable input.

The testing of robustness is really a test of


Levels of
error handling.

Problem
Severity?

1. Do we anticipate the error situations?


2. Do we issue informative error messages?
3. Do we allow some kind of recovery from the error?

2 independent inputs for robustness test


X

Y
- Note that there needs to be only 13 test cases for 2 independent
variables or inputs.
- In general, there will be (6n+ 1) test cases for n independent inputs.

More on Robustness Testing


Perhaps a little more than 7 test cases?
beyond the boundary cases should include
other illegal inputs
For numeric field should we try some non-numeric input?
How about blank or no input?

So perhaps we ought to consider 8 or 9 as a


more reasonable number of test cases when
we consider all types of outside the
boundary cases for Robustness Testing

Worst-Case testing for non-independent variables


If the input variables are not independent, then
we would need to test all possible combinations
of values that the variable may take on.
For Boundary Value Testing, each of the 5 possible
values of a variable must iterate through the 5 possible
values of the other variable(s).
Thus for n input variables, there are 5n possible test cases

For Robustness Testing, each of the 7 possible values


of a variable must iterate through the 7 possible values
of the other variable(s).
Thus for n input variables, there are 7n possible test cases

2 non-independent inputs for worst case test


X

For 2 non-independent
variables, there are
52 = 25 test cases

Y
- In general, there will be 5n test cases for n non-independent inputs.

Hierarchy
For n = number of variables (input fields)

Boundary Value testing of n inputs :


Robustness testing of n inputs
:
Worst case for boundary value
:
Worst case for robustness
:

4n + 1
6n + 1
5n
7n

- Boundary Value is a subset of Robustness


- Worst case for boundary value is a subset of worst case of robustness

Some Special Value and Random Testing


Special Value Testing:

Based on experience
Based on special knowledge of the industry
Ad hoc in nature
Has had some very valuable inputs
Costly to find the industry experts

Especially for
multiple
dependent and
legitimate test
cases

Random Value Testing:


Based on some random number generator
Generate values within bounds of the boundary or worst case
The value of random test has not been clearly justified except
we may be able to automate this

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy