Black Box Test Techniques

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 15

Black Box Test Techniques

Tests are designed to answer the following


questions:

a)How is functional validity tested ?

b)What classes of input will make good test


cases?

c)Is the system particularly sensitive to


certain input values?

d)What effect will specific combinations of


data have on system operations?
Black Box Test Techniques

• Equivalence Partitioning
• Boundary Value Analysis
• Error Guessing
• Cause Effect Graphing
• State transition testing
Equivalence Partitioning
• This method divides the input domain of a
program into categories of data for deriving test
cases.

• Identify equivalence classes - the input ranges


which are treated the same by the software
– - Valid classes: legal input ranges
– - Invalid classes: illegal or out of range input
values

• The aim is to group and minimize the number of


test cases required to cover these input
conditions
Equivalence Partitioning
Assumption:

• If one value in a group works, all will work


One from each partition is better than all from
one

• Thus it consists of two steps:


 Identify the Equivalence class
 Write test cases for each class
Equivalence Partitioning

Examples of types of equivalence classes


• 1. If an input condition specifies a continuous
range of values, there is one valid class and
two invalid classes
Example: The input variable is a mortgage
applicant’s income. The valid range is
$1000/mo. to $75,000/mo.
- Valid class: {1000 > = income < =
75,000}
- Invalid classes: {income < 1000},
{income > 75,000}
Equivalence Partitioning

2. If an input condition specifies that a variable,


say count, can take range of values(1 - 999),

Identify - one valid equivalence class (1 < count


< 999)
- two invalid equivalence classes (count
< 1) & (count >999)
Equivalence Partitioning

3. If a “must be” condition is required, there is


one valid equivalence class and one invalid
class

Example: The mortgage applicant must be a


person.
- Valid class: {person}
- Invalid classes:{corporation, ...anything
else...}
Boundary Value Analysis

• Boundary Conditions are those situations directly


on, above, and beneath the edges of input
equivalence classes and output equivalence classes.

• Test cases at the boundary of each input Includes


the following :
– At the boundary
– Just below the boundary
– Just above the boundary
Boundary Value Analysis

From previous example, we have the valid


equivalence class as (1 < count < 999).
Now, according to boundary value analysis,
we need to write test cases for

count=0,count=1,count=2,count=998,
count=999 and count=1000 respectively
Error Guessing

• Based on experience and intuition one may add


more test cases to those derived by following
other methodologies.

• It is an ad hoc approach

• The basis behind this approach is in general


people have the knack of “smelling out” errors
Error Guessing
• Make a list of possible errors or error-prone situations
and then develop test cases based on the list.

• Defects’ history are useful. Probability that defects


that have been there in the past are the kind that are
going to be there in the future.

• Some examples :
• Empty or null lists/strings
Zero occurrences
• Blanks or null character in strings
• Negative numbers
Error Guessing
• Example : Suppose we have to test the login screen
of an application. An experienced test engineer may
immediately see if the password typed in the
password field can be copied to a text field which may
cause a breach in the security of the application.

• Error guessing testing for sorting subroutine


situations
» - The input list empty
» - The input list contains only one entry
» - All entries in the list have the same
value
» - Already sorted input list
Cause Effect Graphing

• A testing technique that aids in selecting, in a


systematic way, a high-yield set of test cases that
logically relates causes to effects to produce test
cases.
• It has a beneficial side effect in pointing out
incompleteness and ambiguities in specifications.
• Steps:
- Identify the causes and effects from the
specification
- Develop the cause effect diagram
- Create a decision table.
- Develop test cases from the decision table.
Test Case Design -
Summary

• The test case techniques discussed so far need


to be combined to form overall strategy

• Each technique contributes a set of useful test


cases, but none of them by itself contributes a
thorough set of test cases
Test Case Design –
Summary
Use of the following design strategy may not
guarantee all errors are found but it represents
a reasonable compromise
1. If the specification contains combinations of
input conditions - start with cause-effect
graphing
2. Identify valid and invalid equivalence classes
for input and output and supplement the test
cases
3. Use boundary value analysis
4. Use error guessing to add additional test
cases

You might also like