0% found this document useful (0 votes)
377 views27 pages

CH 4

Uploaded by

api-325935419
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)
377 views27 pages

CH 4

Uploaded by

api-325935419
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/ 27

Software Testing

Naresh Chauhan, Assistant

Professor in the Department of


Computer Engineering at the YMCA
University of Science and Technology,
Faridabad

Oxford University Press 2011. All rights

Chapter 4
Dynamic Testing: Black
Box Testing Techniques

Oxford University Press 2011. All rights

Objectives

Black box testing ignores the structural details of the software.


Test case designing using black box techniques.
Boundary value analysis method
Equivalence class testing method
State table based testing method
Decision table based testing method
Cause-effect graphing method

Oxford University Press 2011. All rights

Black Box Testing

Evolution of Software Testing

Oxford University Press 2011. All rights

Black Box Testing

Evolution of Software Testing

To test the modules independently.

To test the functional validity of the software

Interface errors are detected.

To test the system behavior and check its performance.

To test the maximum load or stress on the system.

Customer accepts the system within defined acceptable limits.

Oxford University Press 2011. All rights

Boundary Value Analysis (BVA)

Oxford University Press 2011. All rights

Boundary Value Checking

Test cases are designed by holding one variable at its extreme value
and other variables at their nominal values in the input domain. The
variable at its extreme value can be selected at:

Minimum value (Min)


Value just above the minimum value (Min+ )
Maximum value (Max)
Value just below the maximum value (Max-)

Oxford University Press 2011. All rights

Boundary Value Checking

Anom, Bmin
Anom, Bmin+
Anom, Bmax
Anom, BmaxAmin, Bnom
Amin+, Bnom
Amax, Bnom
Amax-, Bnom
Anom, Bnom

4n+1 test cases can be designed with boundary value checking


method.
Oxford University Press 2011. All rights

Robustness Testing Method

A value just greater than the Maximum value (Max+)


A value just less than Minimum value (Min-)
When test cases are designed considering above points in
addition to BVC, it is called Robustness testing.
Amax+, Bnom
Amin-, Bnom
Anom, Bmax+
Anom, BminIt can be generalized that for n input variables in a module, 6n+1
test cases are designed with Robustness testing.

Oxford University Press 2011. All rights

Worst Case
Testing Method
Software
Testing
Myths

When more than one variable are in extreme values, i.e. when more
than one variable are on the boundary. It is called Worst case
testing method.

It can be generalized that for n input variables in a module, 5n test


cases are designed with worst case testing.

Oxford University Press 2011. All rights

10

Example

A program reads an integer number within the range [1,100] and


determines whether the number is a prime number or not. Design all
test cases for this program using BVC, Robust testing and worstcase testing methods.

1) Test cases using BVC

Oxford University Press 2011. All rights

11

Example

Test Cases Using Robust Testing

Oxford University Press 2011. All rights

12

Equivalence Class Testing

Oxford University Press 2011. All rights

13

Example

A program reads three numbers A, B and C with range [1,50] and


printsI1largest
number.
= {<A,B,C>
: 1 Design
A all test cases for this program using
equivalence class
50} testing technique.
I2 = {<A,B,C> : 1 B
50}
I3 = {<A,B,C> : 1 C
50}
I4 = {<A,B,C> : A < 1}
I5 = {<A,B,C> : A > 50}
I6 = {<A,B,C> : B < 1}
I7 = {<A,B,C> : B >
50}
I8 = {<A,B,C> : C < 1}
I9 = {<A,B,C> : C >
50}
Oxford University Press 2011. All rights

14

Example

I1 = {<A,B,C> : A > B, A > C}


I2 = {<A,B,C> : B > A, B > C}
I3 = {<A,B,C> : C > A, C > B}
I4 = {<A,B,C> : A = B, A C}
I5 = {<A,B,C> : B = C, A B}
I6 = {<A,B,C> : A = C, C B }
I7 = {<A,B,C> : A = B = C}

Oxford University Press 2011. All rights

15

State Table Based Testing

Finite State Machine (FSM)


State Transition Diagrams or State Graph

Oxford University Press 2011. All rights

16

State Table Based Testing

State Table

Oxford University Press 2011. All rights

17

State Table Based Testing

Oxford University Press 2011. All rights

18

Decision Table Based Testing

Oxford University Press 2011. All rights

19

Decision Table Based Testing

Example

A program calculates the total salary of an employee with the conditions that
if the working hours are less than or equal to 48, then give normal salary.
The hours over 48 on normal working days are calculated at the rate of 1.25
of the salary. However, on holidays or Sundays, the hours are calculated at
the rate of 2.00 times of the salary. Design the test cases using decision
table testing.

Oxford University Press 2011. All rights

20

Decision Table Based Testing

Oxford University Press 2011. All rights

21

Cause-Effect Graphing based Testing

Basic Notations for Cause-Effect Graph

Oxford University Press 2011. All rights

22

Cause-Effect Graphing based Testing

Example
A program has been designed for the determination of nature of
roots of a quadratic equation. Quadratic equation takes three input
values from the range [0,100]. Design all test cases using CauseEffect graphing technique.

Oxford University Press 2011. All rights

23

Cause-Effect Graphing based Testing

C1: a 0
C2: b = 0
C3: c = 0
C4: D > 0 where D is b2 4 * a * c
C5: D < 0
C6: D = 0
C7: a = b = c
C8: a = c = b/2
E1: Not a quadratic equation
E2: Real Roots
E3: Imaginary Roots
E4: Equal Roots

Oxford University Press 2011. All rights

24

Cause-Effect Graphing based Testing

Oxford University Press 2011. All rights

25

Cause-Effect Graphing Based Testing

Oxford University Press 2011. All rights

26

Error Guessing

Error guessing is the method used when all other methods fail or it
is the method for some special cases which need to be tested.

It means error or bug can be guessed which do not fit in any of the
earlier defined situations. So test cases are generated for these
special cases.

Oxford University Press 2011. All rights

27

You might also like