2. TESTING
• Software testing is a process to find out
the bugs and errors from the applications.
• Dynamic Testing methodologies are of 2
types:
i) Specification based / Functional / Black
box testing
ii) Structured based / Non-functional/
White box testing
3. BLACK BOX TESTING
• Black Box Testing is a method in which we
focus on inputs and output of the software
system without bothering about internal
knowledge of the software program.
• 5 Types of Black box testing:
STATE TRANSITION DIAGRAM
DECISION TABLE TECHNIQUE
USE CASE TECHNIQUE
EQUIVALENCE PARTITIONING
BOUNDARY VALUE ANAYSIS
4. STATE TRANSITION DIAGRAM
• It is a type of black box testing
• In this technique various test cases are
designed to execute the valid as well as
invalid transactions.
• While preparing this diagram, states can
be start state, waiting state, execution
state, holding state, ending state.
5. STATE TRANSITION DIAGRAM
Example: ATM pin entry
Start
Wait for
pin no.
To
validate
Access
to
account
Exit
First
entry
INPUT:
• Card
•Pin no.
OUTPUT:
•Access to account
6. DECISION TABLE TECHNIQUE
• It is a type of black box testing which has a
tabular representations.
• We check all the permutation and
combination of input as well as
corresponding output.
• Table consists of 2 sections:
i) Stub section
ii) Entry section
7. DECISION TABLE TECHNIQUE
Example Discount policy
• Consider the following decision tree and make
the decision table on discount policy
Type of customer Order size Discount
Faculty 6 or more 25%
less than 6 Nil
Discount
Policy
50 or more 15%
Individual 20-49 5%
8. DECISION TABLE TECHNIQUE
Example Discount policy
Condition Stub
1 2 3 4
Customer is a faculty member Y Y N N
order size 6 or more Y N N N
order size < 6 N Y N N
Customer is an individual N N Y Y
order size 50 or more N N Y N
order size 20-49 N N N Y
Action Stub
25% X - - -
0% - X - -
15% - - X
5% - - - X
Condition Entry
Action Entry
9. USE CASE TECHNIQUE
• A use case is a description of a particular
use of the system by an actor.
• Use case describes the interaction
between the use case and the actor in
order to achieve a specific task.
• Use case testing is a black box test design
in which test cases are designed to
execute the users scenario.
11. USE CASE TECHNIQUE
Example: ATM machine
Steps Description
Main success scenario
Extensions
1
2
3
4
5
2a
4a
4b
4c
A: Insert card
Validate and ask for Pin number
Enter PIN
Validate Pin
Allow access to account
Card not valid
PIN number incorrect
Pin Valid
Pin Invalid thrice, Exit
12. EQUIVALENCE PARTIONING
• Equivalence partitioning is a type of black
box testing.
• Divide the input data into equivalence
classes/partition.
• Partition represent Valid input values.
• Partition represent Invalid input values.
13. EQUIVALENCE PARTIONING
Example
• One of the fields on a form contains a text box
which accepts numeric values in the range of
18 to 25. Identify the Equivalence class?
• The text box accepts numeric values in the
range 18 to 25.So this class becomes our valid
class.
– Class I: values < 18 => invalid class
– Class II: 18 to 25 => valid class
– Class III: values > 25 => invalid class
14. BOUNDARY VALUE ANALYSIS
• Boundary Value Analysis is also called range
checking.
• Equivalence partitioning and boundary value
analysis are closely related and can be used
together at all levels of testing.
• Valid boundaries (in the valid partitions)
• Invalid boundaries (in the invalid partitions)
• 3 Classes:
i)On the Boundary
ii) Below the Boundary
iii) Above the Boundary
15. BOUNDARY VALUE ANALYSIS
Example
• A program validates a numeric field as
follows: values less than 10 are rejected,
values between 10 and 21 are accepted,
values greater than or equal to 22 are
rejected. Which of the following covers the
MOST boundary values?
– Class I: values < 10 => Above the Boundary
– Class II: 10 to 21 => On the Boundary
– Class III: values >= 22 => Below the Boundary
16. Black Box Testing
Advantages Disadvantages
•Well suited and efficient for large code
segments.
•Code Access not required.
•Clearly separates user's perspective
from the developer's perspective
through visibly defined roles.
•Large numbers of moderately skilled
testers can test the application with no
knowledge of implementation,
programming language or operating
systems.
•Limited Coverage since only a selected
number of test scenarios are actually
performed.
•Inefficient testing, due to the fact that
the tester only has limited knowledge
about an application.
•Blind Coverage, since the tester cannot
target specific code segments or error
prone areas.
•The test cases are difficult to design.
17. WHITE BOX TESTING
• White Box Testing also called as structural
testing because we check the code and
control structures used in a program.
• 4 Types of White box testing:
BASIC PATH TESTING
LOOP TESTING
CONTROL STRUCTURE TESTING
18. BASIC PATH TESTING
• Known as : Control flow, program graph.
• 2 symbols used: circle = node
line = flow
• We calculate the cyclomatic complexity
using the formula.
Cc=E-N+2
Cc=P+1
Cc= no. of regions
19. BASIC PATH TESTING Example
Draw a flowchart and flow graph to calculate factorial of
a number and calculate its cyclomatic complexity.
FLOW CHART FLOW GRAPH
Read N
start
C=1, Fact=1
Is
C=N
Fact=Fact*C
stop
Print
false
true
2,3
1
4
5 6
7
CYCLOMATIC
COMPLEXITY
1) CC = E – N +2
=6-6+2
=2
2) CC = P+1
=1+1
=2
3) No. of region=2
20. WHITE BOX TESTING
Advantages Disadvantages
•As the tester has knowledge of the
source code, it becomes very easy to
find out which type of data can help in
testing the application effectively.
•It helps in optimizing the code.
•Extra lines of code can be removed
which can bring in hidden defects.
•Due to the tester's knowledge about the
code, maximum coverage is attained
during test scenario writing.
•Due to the fact that a skilled tester is
needed to perform white box testing, the
costs are increased.
•Sometimes it is impossible to look into
every nook and corner to find out hidden
errors that may create problems as many
paths will go untested.
•It is difficult to maintain white box
testing as the use of specialized tools
like code analyzers and debugging tools
are required.