Black-box Testing Black-box Testing Categories Types of Black box testing Equivalence class...

26

Transcript of Black-box Testing Black-box Testing Categories Types of Black box testing Equivalence class...

Page 1: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.
Page 2: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

•Black-box Testing•Black-box Testing Categories•Types of Black box testing

Equivalence class PartitioningBoundary Value AnalysisCause and Effect Decision Table

• Advantages of Black Box Testing • Disadvantages of Black Box Testing

Page 3: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Complements white-box testing by uncovering different classes of errors

Focuses on the functional requirements and the information domain of the software

Used during the later stages of testing after white box testing has been performed

The tester identifies a set of input conditions that will fully exercise all functional requirements for a program

The test cases satisfy the following:◦ Reduce, by a count greater than one, the number of additional

test cases that must be designed to achieve reasonable testing◦ Tell us something about the presence or absence of classes of

errors, rather than an error associated only with the specific task at hand

BACK

Page 4: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Incorrect or missing functions Interface errors Errors in data structures or external data base access Behavior or performance errors Initialization and termination errors

BACK

Page 5: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Equivalence class partitioning Boundary value analysis Decision Table based testing Cause Effect Graph

BACK

Page 6: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

A black-box testing method that divides the input domain of a program into classes of data from which test cases are derived

An ideal test case single-handedly uncovers a complete class of errors, thereby reducing the total number of test cases that must be developed

Test case design is based on an evaluation of equivalence classes for an input condition

An equivalence class represents a set of valid or invalid states for input conditions

Page 7: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

From each equivalence class, test cases are selected so that the largest number of attributes of an equivalence class are exercise at once

Input values to a program are partitioned into equivalence classes.

Partitioning is done such that:

◦ program behaves in similar ways to every input value belonging to an equivalence class.

Page 8: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

If the input data to the program is specified by a range of values:◦ e.g. numbers between 1 to 5000. ◦ one valid and two invalid equivalence classes are defined.

1 5000

Page 9: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

There are three equivalence classes: ◦ the set of negative integers, ◦ set of integers in the range of 1 and 5000, ◦ integers larger than 5000.

1 5000

BACK

Page 10: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

A greater number of errors occur at the boundaries of the input domain rather than in the "center"

Boundary value analysis is a test case design method that complements equivalence partitioning◦ It selects test cases at the edges of a class◦ It derives test cases from both the input domain and output

domain

Page 11: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Some typical programming errors occur: ◦ at boundaries of equivalence classes ◦ might be purely due to psychological factors.

Programmers often fail to see: special processing required at the boundaries of equivalence

classes. Programmers may improperly use < instead of <= Boundary value analysis:

◦ select test cases at the boundaries of different equivalence classes.

Page 12: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

For a function that computes the square root of an integer in the range of 1 and 5000:◦ test cases must include the values: {0,1,5000,5001}.

1 5000

BACK

Page 13: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Testing would be a lot easier:◦ if we could automatically generate test cases from

requirements. Work done at IBM:

◦ Can requirements specifications be systematically used to design functional test cases?

Page 14: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Examine the requirements:◦ restate them as logical relation between inputs and outputs.◦ The result is a Boolean graph representing the

relationships called a cause-effect graph. Convert the graph to a decision table:

◦ each column of the decision table corresponds to a test case for functional testing

Page 15: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Study the functional requirements. Mark and number all causes and effects. Numbered causes and effects: become nodes of the graph. Draw causes on the LHS Draw effects on the RHS Draw logical relationship between causes and effects

◦ as edges in the graph. Extra nodes can be added

◦ to simplify the graph

Page 16: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

A B

If A then B

A

C

If (A and B)then C

B

Page 17: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

AC

If (A or B) then CB

AC

If (not(A and B)) then C

B~

Page 18: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

AC

If (not (A or B))then CB

A B

If (not A) then B

~

~

BACK

Page 19: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Two dimensional mapping of condition against actions to be performed◦ Conditions evaluate to Boolean◦ Action corresponds to expected activity

They can be derived from Cause Effect graph too◦ Map cause as condition◦ Map effect as action

Page 20: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Cause 1

Cause 2

Cause 3

Cause 4

Cause 5

Effect 1

Effect 2

Effect 3

Test 1 Test 2 Test 3 Test 4 Test 5

I I II

I

I IS IX S

S

SS

S

P P

S

I

S

A A A

AAP

PP

A

A

A

A A

X

XX

X

XXI

Page 21: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Put a row in the decision table for each cause or effect:◦ in the example, there are five rows for causes and three

for effects. The columns of the decision table correspond to test cases. Define the columns by examining each effect:

◦ list each combination of causes that can lead to that effect.

We can determine the number of columns of the decision table◦ by examining the lines flowing into the effect nodes of the

graph.

Page 22: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Theoretically we could have generated 25=32 test cases.◦ Using cause effect graphing technique reduces that number

to 5.

Page 23: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

Not practical for systems which:◦ include timing aspects◦ feedback from processes is used for some other processes.

BACK

Page 24: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

more effective on larger units of code than glass box testing tester needs no knowledge of implementation, including

specific programming languages tester and programmer are independent of each other tests are done from a user's point of view will help to expose any ambiguities or inconsistencies in the

specifications test cases can be designed as soon as the specifications are

complete

BACK

Page 25: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

only a small number of possible inputs can actually be tested, to test every possible input stream would take nearly forever

without clear and concise specifications, test cases are hard to design

there may be unnecessary repetition of test inputs if the tester is not informed of test cases the programmer has already tried

may leave many program paths untested cannot be directed toward specific segments of code which

may be very complex (and therefore more error prone) most testing related research has been directed toward glass

box testingBACK

Page 26: Black-box Testing Black-box Testing Categories Types of Black box testing  Equivalence class Partitioning Equivalence class Partitioning  Boundary Value.

BACK TO INDEX