0% found this document useful (0 votes)
45 views66 pages

Unit 5

Uploaded by

NIKHIL NIKHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views66 pages

Unit 5

Uploaded by

NIKHIL NIKHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 66

Course Academic

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

• The main objective of software testing is to design


the tests in such a way that it systematically finds
different types of errors without taking much time and
effort so that less time is required for the development
of the software.

SOFTWARE ENGINEERING 3
SOFTWARE TESTING - Terminologies

SOFTWARE ENGINEERING 4
SOFTWARE TESTING STRATEGIES
• What is Testing?
• Step-1:Example: some software under test.

• Step-2: When we're doing testing, we always require a source of


test inputs which result in test outputs.

• Step-3: The outputs are processed by an acceptability check.

• 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

• For a software process a set of test case design


techniques and testing methods are defined

• A number of testing methods are proposed

SOFTWARE ENGINEERING 7
Testing Strategies – Generic Characteristics
• To perform effective testing a software team should
conduct effective formal technical reviews.

• Testing begins at the component level and works


outward toward the integration of the entire computer
based system

• Testing is conducted by the developer of the software


and for large projects an independent test group

SOFTWARE ENGINEERING 8
Testing Vs Debugging
• Testing and debugging are different activities, But
debugging must be accommodated in any testing
strategy

• A strategy must provide guidance for the practitioner


and a set of mile stones for the manager

SOFTWARE ENGINEERING 9
Verification and Validation
• Verification
• is the process of checking that the software meets
specifications

• The verifying process includes checking documents,


design, code, and program.

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

• Test Case: is a set of conditions under which a tester will


determine whether an application, software system or one of its
features is working as it was originally established for it to do.
Unit Testing

module
to be
tested
interface
local data structures

boundary conditions
independent paths
error handling paths

test cases
Unit Test Environment

Stubs are the modules that act as temporary replacement for a


called module and give the same output as that of the actual product.
Integration Testing
• Top Down Integration
• Depth First Integration
• Breadth First integration
• Bottom-up Integration G
Top Down Integration

A
top module is tested with
stubs

B F G

stubs are replaced one at


a time, "depth first"
C
as new modules are integrated,
some subset of tests is re-run
D E
Top Down Integration
• This testing is an incremental approach to construction of the software
architecture
• The modules are integrated by moving downward through the control hierarchy
begin with main control module [Main program]
• The subordinate module to main control module are integrated either in a Depth
first (Or) Breadth first manner
Top Down Integration
• Depth First Integration:
• * It integrates all components on a major control path of the program structure
• * Selection of major path depends on application specific characteristics
• * For example, selecting the left hand path components M1, M2, M5 would be integrated
first and next M8
• * Then the central and right hand control paths are built

• Breadth First integration:


• It incorporates all components
directly subordinate at each level,
moving tree structure horizontally
• In the above figure components M2, M3 and M4
would be Integrated first and next M5, M6
and so on..
Bottom-Up Integration

B F G

drivers are replaced one at a


time, "depth first"
C

worker modules are grouped into


builds and integrated
D E
cluster
Bottom-Up Integration
Steps followed in the Bottom – Up Integration:

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 3: The cluster is tested

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.

When to Perform Regression Testing?

Regression tests are frequently executed throughout the "software testing life cycle" at
each different level; "unit", "integration", "system" and "acceptance".

Steps to Conduct Regression Testing?


 A basic approach to carry out regression testing comprises of following actions:
 Re-execution of already conducted tests.
 Comparison of older test and fresh test results.
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
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 carried out by testers. It is carried out by software developers.

This method is used in System Testing or This method is used in


Acceptance Testing. Unit Testing or Integration Testing.

It is the least time consuming. It is most time consuming.

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

An Independent path is any path through the program that


introduces at lest one new set of processing statements or a
new condition.
Graph Matrices with example
Independent Program Paths
 Cyclomatic Complexity:
is computed one of three ways
1. The Number of regions of the graph
V(G)=R
2. Cylomatic complexity V(G) for a flow graph G is defined as

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:

Find the following:


Cyclomatic Complexity
No. of Paths

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

• Boundary value analysis is one of the widely


used case design technique for black box
testing. It is used to test boundary values
because the input values near the boundary
have higher chances of error.
• Whenever we do the testing by boundary value
analysis, the tester focuses on, while entering
boundary value whether the software is
producing correct output or not.
Boundary Value Testing
THE END

You might also like