Unit 5
Unit 5
Course Name UG L T P C
Code Year
Software III B. Tech CSE
A4603 2020-2021 3 0 2 4
Engineering I Semester
Software Engineering
CSE A & B
UNIT-5
SOFTWARE TESTING STRATEGIES
Faculty
Dr. S Venu Gopal
Associate Professor
Department of CSE
Today’s Session: Outlines
• Objective
• A Strategic Approach to Software Testing
• Testing Strategies – Generic Characteristics
• Testing Vs Debugging
• Verification and Validation
• Organizing for Software Testing
• Software Testing Steps
SOFTWARE ENGINEERING 2
SOFTWARE TESTING STRATEGIES
• Objective
SOFTWARE ENGINEERING 3
SOFTWARE TESTING - Terminologies
SOFTWARE ENGINEERING 4
SOFTWARE TESTING STRATEGIES
• What is Testing?
• Step-1:Example: some software under test.
• Step-4: If the outputs are okay, then the test case succeeded.
• Step-5: If the outputs are not okay, then the test case failed and
we're going to have to debug.
SOFTWARE ENGINEERING 5
SOFTWARE TESTING STRATEGIES
• What is Testing?
SOFTWARE ENGINEERING 6
A Strategic Approach to Software Testing
• Testing is a set of activities that can be planned in
advance and conducted systematically
SOFTWARE ENGINEERING 7
Testing Strategies – Generic Characteristics
• To perform effective testing a software team should
conduct effective formal technical reviews.
SOFTWARE ENGINEERING 8
Testing Vs Debugging
• Testing and debugging are different activities, But
debugging must be accommodated in any testing
strategy
SOFTWARE ENGINEERING 9
Verification and Validation
• Verification
• is the process of checking that the software meets
specifications
SOFTWARE ENGINEERING 10
Verification and Validation
• Validation is the process of checking whether the
specification captures the customer's requirements
• Validation
• is a dynamic mechanism of Software testing and
validates the actual product.
SOFTWARE ENGINEERING 11
Verification and Validation
SOFTWARE ENGINEERING 12
Organizing for Software Testing
• Software Testing Strategy:
SOFTWARE ENGINEERING 13
Software Testing Steps
Testing Strategy
Example
1. Login on Valid
Credentials
2. View Current
Requirements Balance
Analysis
3. Deposit Money
4. Withdraw Money
5. Transfer Money
Architecture
Functional
Specification Stage
Unit Testing Example
Strategies for Conventional Software Testing
• Unit Testing
– Unit Testing Environment
• Integration Testing
– Top Down Integration
– Bottom Up Integration
• Regression Testing
Unit Testing
module
to be
tested
results
software
engineer
test cases
module
to be
tested
interface
local data structures
boundary conditions
independent paths
error handling paths
test cases
Unit Test Environment
A
top module is tested with
stubs
B F G
B F G
Step 1: Low level components are combined into Clusters [also called builds] that perform a specific software function
Step 2: A driver [a control program for testing] is written to coordinate test case input and output
Step 4: Drivers are removed and Clusters are combined moving upward in the program structure
Regression Testing
Regression testing is the re-execution of some subset of tests that have already
been conducted to ensure that changes have not propagated unintended side
effects
Regression Testing is a Software Testing type in which test cases are re-executed in
order to check whether the previous functionality of the application is working fine
and the new changes have not introduced any new bugs.
Regression tests are frequently executed throughout the "software testing life cycle" at
each different level; "unit", "integration", "system" and "acceptance".
• (2) The symptom may disappear [temporarily] when another error is corrected
• (3) The symptom may actually be caused by non errors [e.g. round off inaccuracies]
• (4) The symptom may be caused by human error that is not easily traced
• (5) The symptom may be a result of timing problems rather than processing problems
• (6) It may be difficult to accurately reproduce input conditions [e.g. a real time
application in which input ordering is indeterminate] not exactly defined, not known..
• (7) The symptom may be intermittent. This is particularly common in embedded systems
that couple hardware and software inextricable (not possible to separate)
• (8) The symptom may be due to causes that are distributed across a number of tasks
running on different processors
Software Testing
white- black-
box box
methods
methods
Methods
Strategies
White-box testing
• White-box testing is a method of software
testing that tests internal structures or
workings of an application, as opposed to
its functionality.
• In white-box testing, an internal
perspective of the system is used to
design test cases.
White-box testing
Black-box testing
• Black-box testing is a method of software testing that
examines the functionality of an application without
peering into its internal structures or workings.
• The advantages of black box testing include
its simplicity and independence from technical
aspects, making it accessible to testers with varying
levels of technical knowledge.
• It also allows for early detection of functional issues,
as it can be executed before the development team
completes the implementation details.
Black-box testing
Black Box Vs White Box Testing
Black Box Testing White Box Testing
The Black Box Test is a test that only considers the The White Box Test is a method used to test a
external behavior of the system; the internal workings software taking into consideration its internal
of the software is not taken into account. functioning.
It is the behavior testing of the software. It is the logic testing of the software.
It is also known as data-driven testing, It is also known as clear box testing, code-based
functional testing, and closed box testing. testing, structural testing, and transparent testing.
Black Box Test is not considered for algorithm testing. White Box Test is well suitable for algorithm testing.
Black Box Vs White Box Testing
Testing Techniques
White Box Testing or Glass Box Testing
Basis Path Testing
Flow Graph Notation
Independent Program Paths, Cyclomatic Complexity
Deriving Test Cases
Graph Matrices
Control Structure Testing
Condition Testing
Data Flow Testing
Loop Testing
Black Box Testing or Behavioral Testing
Graph-Based Testing Methods
Equivalence Partitioning
Boundary Value Testing
Basis Path Testing
Flow Graph Testing: Logical flow of the Program is called control flow
graph
Flow Chart and Flow Graph
Independent Program Paths
Independent Program Paths
V(G)=E-N+2
3. Cylomatic complexity V(G) for a flow graph G is defined as
V(G)=P+1 where P is the Predicate Node in flow graph.
A predicate node is a node with more than one edge emerging
from it.
Graph Matrices:
SOFTWARE ENGINEERING 48
Example: Find the Values
Graph Matrices
SOFTWARE ENGINEERING 49
• Cyclomatic Complexity:
1. V(G)=R =3
2. V(G)=E-N+2 = 8-7+2 = 3
3. V(G)=P+1 = 2+1 = 3
4. Graph Matrices
Example:
SOFTWARE ENGINEERING 51
• Cyclomatic Complexity:
1. V(G)=R
2. V(G)=E-N+2
3. V(G)=P+1
Graph Matrices
Example:
SOFTWARE ENGINEERING 53
• Cyclomatic Complexity:
1. V(G)=R = 4
2. V(G)=E-N+2 = 9-7+2 = 4
3. V(G)=P+1 = 3+1 = 4
Graph Matrices
Example:
SOFTWARE ENGINEERING 55
• Cyclomatic Complexity:
1. V(G)=R
2. V(G)=E-N+2
3. V(G)=P+1
Control Structure Testing
• Control Structure Testing
• Condition Testing
• Data Flow Testing
• Loop Testing
• Condition coverage testing is a type of white-box testing
that tests all the conditional expressions in a program for
all possible outcomes of the conditions.
• It is also called predicate coverage.
• Condition coverage testing tests the conditions
independently of each other.
SOFTWARE ENGINEERING 57
Data flow testing
• Data flow testing is used to analyze the flow of data
in the program.
• It is the process of collecting information about
how the variables flow the data in the program.
• Anomalies in the flow of data are detected at the
time of associations between values and variables
due to:
• If the variables are used without initialization.
• If the initialized variables are not used at least once.
Loop Testing
• Loop Testing is a kind of software testing that
checks the accuracy of the loop constructions.
• There is one component of Control Structure
Testing for path testing, validation testing for
wrong data, and condition testing for different
scenarios.
• Loop testing is an example of white-box
testing.
Black Box Testing
Black Box Testing or Behavioral Testing
Graph-Based Testing Methods
Equivalence Partitioning
Boundary Value Testing
Graph-Based Testing Methods
• Graph-based testing first builds a graph model
for the program under test, and then tries to
cover certain elements in the graph model.
• Graph is one of the most widely used
structures for abstraction. – Graph is a well-
defined, well-studied.
Graph Matrices with example
Equivalence Partitioning
• Equivalence partitioning is a black-box testing technique that allows testers
to group input data into sets or classes, making it possible to reduce the
number of test cases while still achieving comprehensive coverage.
• This technique is particularly useful when dealing with a large range of
input values.
Boundary Value Testing