Professional Documents
Culture Documents
Se Unit-5
Se Unit-5
SOFTWARE ENGINEERING
SOFTWARE TESTING STRATEGIES
• Objective
SOFTWARE ENGINEERING
SOFTWARE TESTING - Terminologies
SOFTWARE ENGINEERING
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
SOFTWARE TESTING STRATEGIES
• What is Testing?
SOFTWARE ENGINEERING
A Strategic Approach to Software Testing
• Testing is a set of activities that can be planned in
advance and conducted systematically
SOFTWARE ENGINEERING
Testing Strategies – Generic Characteristics
• To perform effective testing a software team should
conduct effective formal technical reviews.
SOFTWARE ENGINEERING
TESTING DEBUGGING
Testing is the process of executing Debugging is the process of
software with intent to find or detecting and correcting errors
detect bugs
Error Detection is the goal of Error Detection and Correction is
testing the goal of debugging
Testing starts with known Debugging starts with unknown
conditions conditions
The output is predictable The output is unpredictable
Testing proves a programmer's Debugging is the programmer's
failure vindication(Justification).
Much testing can be done without Debugging is impossible without
. design knowledge detailed design Knowledge
Testing can often be done by an Debugging must be done by an
outsider insider
Much of test execution and design Debugging is still a dream.
Can be automated
SOFTWARE ENGINEERING
Verification and Validation
• Verification
• is the process of checking that the software meets
specifications
SOFTWARE ENGINEERING
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
Verification and Validation
SOFTWARE ENGINEERING
Organizing for Software Testing
• Software Testing Strategy:
SOFTWARE ENGINEERING
Software Testing Steps
Testing Strategy
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
It is also known as data-driven testing, It is also known as clear box testing, code-
based testing, structural testing, and
functional testing, and closed box testing. transparent testing.
Black Box Test is not considered for White Box Test is well suitable for
algorithm testing. algorithm testing.
Black Box Vs White Box Testing
The Art of Debugging Process
Definition: Debugging is
the process of detecting and
removing of existing and
potential errors
The Art of Debugging Process
• The debugging process begins with the execution of
a test case
• The results are assessed and a lack of
correspondence between expected and actual
performance is encountered
• Debugging attempts to match symptom with there
by leading to error correction
• Debugging will always have one of two outcomes
(i) The cause will be found and corrected
(ii) The cause will not be found
Why is debugging so difficult?
• (1) The symptom and the cause may be geographically remote [i.e. the symptom may
appear in one part of a program, while the cause may actually be located at a site that is
far moved]
• (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
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
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".
Path Testing is a method that is used to design the test cases. In path
testing method, the control flow graph of a program is designed to
find a set of linearly independent paths of execution.
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
Graph Matrices:
SOFTWARE ENGINEERING
Control Structure Testing
Control Structure Testing
Condition Testing
Data Flow Testing
Loop Testing
SOFTWARE ENGINEERING
Condition Testing
• Condition testing method that exercises the logical conditions
contained in a program module.
• A simple condition is a Boolean variable ora relational
expression, possibly preceded with one NOT (¬) operator.
• A relational expression takes the form E1 <relational-operator>
E2
• A compound condition is composed oftwo or more simple
conditions, Boolean operators, and parentheses
• If a condition is incorrect, then at least one component of the
condition is incorrect.
• Therefore, types of errors in a condition include Boolean
operator errors Boolean variable errors, Boolean parenthesis
errors, relational operator errors, and arithmetic expression errors
Data Flow Testing
• Data flow testing is a white-box testing
technique that examines the data flow with
respect to the variables used in the code
• Data Flow Testing uses the control flow graph
to find the situations that can interrupt the
flow of the program.
Loop Testing
• Loop testing is a white-box testing technique
that focuses exclusively on the validity of loop
constructs.
• Four different classes of loops can be defined:
simple loops, concatenated loops, nested
loops, and unstructured loops
Simple loops.
• The following set of tests can be applied to
simple loops where n is the maximum number
of allowable passes through the loop.
• 1. Skip the loop entirely.
• 2. Only one pass through the loop.
• 3. Two passes through the loop
• 4. m passes through the loop where m < n.
• 5. n -1, n, n + 1 passes through the loop.
Nested Loop
• 1. Start at the innermost loop. Set all other loops to
minimum values.
• 2. Conduct simple loop tests for the innermost loop
while holding the outerloops at their minimum
iteration parameter (e.g., loop counter) values.
• Addother tests for out-of-range or excluded values.
• 3. Work outward, conducting tests for the next loop,
but keeping all other outerloops at minimum values
and other nested loops to “typical” values.
• 4. Continue until all loops have been tested
• Concatenated loops. Concatenated loops can be
tested using the approach defined for simple loops,
if each of the loops is independent of the other.
• if two loops are concatenated and the loop counter
for loop 1 is used as the initial value for loop 2,
then the loops are not independent.
• When the loops are not independent, the
approach applied to nested loops is recommended.
• Unstructured loops. Whenever possible, this class
of loops should be redesigned to reflect the use of
the structured programming constructs
Example: Find the Values
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
Graph Matrices
SOFTWARE ENGINEERING
Example:
Cyclomatic Complexity:
1. V(G)=R
2. V(G)=E-N+2
3. V(G)=P+1
Graph Matrices
SOFTWARE ENGINEERING
Example:
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
SOFTWARE ENGINEERING
Example:
Cyclomatic Complexity:
1. V(G)=R
2. V(G)=E-N+2
3. V(G)=P+1
SOFTWARE ENGINEERING