0% found this document useful (0 votes)
9 views13 pages

Notes

The document provides an overview of software testing methodologies, including black box and white box testing, as well as unit testing, system testing, and integration testing. It outlines the differences between various testing models, such as the waterfall and spiral models, and details specific testing techniques like boundary value analysis and equivalence partitioning. Additionally, it discusses the importance of recovery, security, stress, and performance testing in ensuring software quality and reliability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views13 pages

Notes

The document provides an overview of software testing methodologies, including black box and white box testing, as well as unit testing, system testing, and integration testing. It outlines the differences between various testing models, such as the waterfall and spiral models, and details specific testing techniques like boundary value analysis and equivalence partitioning. Additionally, it discusses the importance of recovery, security, stress, and performance testing in ensuring software quality and reliability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

P.

B COLLEGE OF ENGINEERING
Department of Computer Science and Engineering
CCS356 - Object Oriented Software Engineering

Introduction to Testing:
Software testing is a critical element of software quality assurance and
represents the ultimate review of specification design and coding

Difference between white box testing and black box testing

S.No Black Box Testing White Box Testing


1. This method which is used to test This method in which internal
the software without knowing the structure is being known to tester
internal structure of code or who is going to test the software
program
2. This type of testing is carried out Generally, this type of testing is
by testers. carried out by software developers
3. Implementation knowledge is not Implementation knowledge is
required to carry out black box required to carry out white box
testing testing
4. Programming knowledge is not Programming knowledge is required
required to carry out black box to carry out white box testing
testing
5. Testing is applicable on higher Testing is applicable on lower level
levels of testing like system of testing like unit testing, integration
testing, acceptance testing testing
6. Black box testing means functional White box testing means structural
test or external testing test or interior testing
7. Black box testing can be started White box testing can be started
based on requirement based on detail design documents
specifications documents

Testing Vs. Debugging

S.No Black Box Testing White Box Testing


1. Testing is a process in which the Debugging is the process in which
bug is identified the bug or error is corrected by the
programmer
2. In testing process, it is identified In debugging the root cause of error
Where the bug occurs is identified
3. Testing starts with the execution Debugging starts after the testing
results from the test cases process
Unit Testing
Unit testing is a software testing method where individual components or
"units" of code, like functions or methods, are tested in isolation to ensure they
function as expected.

The main steps for carrying out unit tests are:


 Planning and setting up the environment
 Writing the test cases and scripts
 Executing test cases using a testing framework
 Analyzing the results

Difference between water fall model and spiral model

S.No Waterfall model Spiral model


1. Requirements must be clearly The requirements analysis and
understood and defined at the gathering can be done in iterations
beginning only because requirements get changed
quite often.
2. The development team having the The development team having less
adequate experience of working on experience of working on the similar
the similar project a chosen to projects is allowed in this process
work on this type of process model model
3. There is no user involvement in all There is no user involvement in all
the phases of development the phases of development process
process

4. When the requirements are Due to iterative nature of this model,


reasonably well defined and the the risk identification and rectification
development effort suggests a is done before they get a
purely linear effort then the problematic. Hence for handling real
Waterfall model is chosen time problems the spiral model is
chosen
Internal and external view of testing
There are two views of testing.
 The internal view is also known as white box testing
 The external view is also known as Black box testing

Black Box Testing:


Black box testing evaluates software functionality from an end-user perspective
without knowledge of the internal code.

Why to perform black box testing?


Black box testing uncovers the following types of errors
 Incorrect or missing functions
 Interface errors
 Errors in data structures
 Performance Errors
 Initialization or termination errors

Equivalence Partitioning Method


Equivalence Partitioning Method is also known as Equivalence
class partitioning (ECP). It is a software testing technique or black-box testing that
divides input domain into classes of data, and with the help of these classes of
data, test cases can be derived.

An ideal test case identifies class of error that might require many arbitrary
test cases to be executed before general error is observed.

Example:
Let us consider an example of any college admission process. There is a
college that gives admissions to students based upon their percentage

Consider percentage field that will accept percentage only between 50 to 90


%, more and even less than not be accepted, and application will redirect user to
an error page.

Boundary Value Analysis


Boundary Value Analysis is based on testing the boundary values of valid
and invalid partitions. The behavior at the edge of the equivalence partition is more
likely to be incorrect than the behavior within the partition, so boundaries are an
area where testing is likely to yield defects.
 A boundary value for a valid partition is a valid boundary value.
 A boundary value for an invalid partition is an invalid boundary value.
 For each variable we check-
o Minimum value.
o Just above the minimum.
o Nominal Value.
o Just below Max value.
o Max value.

Example: Consider a system that accepts ages from 18 to 56.

Boundary Value Analysis(Age accepts 18 to 56)

Invalid Valid Invalid


(min-1) (min, min + 1, nominal, max – 1, max) (max + 1)

17 18, 19, 37, 55, 56 57

White Box Testing:


White box testing is also called as structural testing. It examines the internal
logic, structure, and code to identify potential issues.
 Conditional Testing
 Loop Testing
 Basis Path Testing

1) Conditional Testing
 To test the logical conditions in the program module the condition testing is
used
 The condition is incorrect in following situations
o Boolean operator is incorrect, missing or extra
o Boolean variable is incorrect
o Boolean parenthesis may be missing, incorrect or extra
o Error in relational operator
o Error in Arithmetic expression
 The condition testing focuses on each testing condition in the program

2) Looping Testing
Loop testing is a white box testing techniques which is used to test the loop
constructs. Basically there are four types of loops
 Simple loop
 Nested loop
 Concatenated loop
 Unstructured loop

a) Simple loop
Simple loop testing is where a condition is given and then the loop runs and
ends, according to both a true and false occurrence of the condition.
b) Nested loop
A nested loop is a loop structure where one loop is placed inside another,
meaning the inner loop executes completely for each iteration of the outer loop

c) Concatenated loop
Concatenated loop testing is performed on the loops that follow each other in
the code, or the execution of the next loop after the previous loops terminates.
d) Unstructured loop
Unstructured loop testing tests a combination of nested and concatenated
loops, in no particular order. In unstructured loop testing, the loops are restructured
to represent the use of programming techniques

3) Basis Path Testing


Basis Path Testing is a white-box testing technique based on the control
structure of a program or a module. Using this structure, a control flow graph is
prepared and the various possible paths present in the graph are executed as a
part of testing

To design test cases using this technique, four steps are followed:
1. Construct the Control Flow Graph
2. Compute the Cyclomatic Complexity of the Graph
3. Identify the Independent Paths
4. Design Test cases from Independent Paths

1. Control Flow Graph


A control flow graph (or simply, flow graph) is a directed graph which
represents the control structure of a program or module. A control flow graph (V, E)
has V number of nodes / vertices and E number of edges in it. A control graph can
also have:
 Junction Node – a node with more than one arrow entering it.
 Decision Node – a node with more than one arrow leaving it.
 Region – area bounded by edges and nodes
Below are the notations used while constructing a flow graph:

 Sequential Statements

 If – Then – Else
 Do – While

 While – Do

 Switch-case
2. Cyclomatic Complexity:
The cyclomatic complexity V(G) is said to be a measure of the logical
complexity of a program. It can be calculated using three different formulae:

(a) Formula based on edges and nodes:


V(G) = e - n + 2*P
Where,
e is number of edges,
n is number of vertices,
P is number of connected components

(b) Formula based on Decision Nodes:


V(G) = d + P
Where,
d is number of decision nodes,
P is number of connected nodes

(c) Formula based on Regions:


V(G) = number of regions in the graph

3. Independent Paths:
An independent path in the control flow graph is the one which introduces at
least one new edge that has not been traversed before the path is defined.

 Path 1:
A -> B
 Path 2:
C -> D

4. Design Test Cases:


Finally, after obtaining the independent paths, test cases can be designed
where each test case represents one or more independent paths.

Basis Path Testing can be applicable in the following cases:


 More Coverage – Basis path testing provides the best code coverage as it
aims to achieve maximum logic coverage instead of maximum path
coverage.
 Maintenance Testing – When software is modified, it is still necessary to
test the changes made in the software which as a result, requires path
testing.
 Unit Testing – When a developer writes the code, he or she tests the
structure of the program or module themselves first.

 Integration Testing – When one module calls other modules, there are high
chances of Interface errors.
 Testing Effort – Since the basis path testing technique takes into account
the complexity of the software

SYSTEM TESTING
System testing is a series of tests that examine the entire workings and
behavior of the integrated software computer system against the end user's needs
and requirements
Various type of system test is
1. Recovery testing
2. Security testing
3. Stress testing
4. Performance testing

The main focus of such tesing is to test


 System functions and performance
 System reliability and recoverabiity
 System installation
 System behaviour in the special conditions
 system user operations
 Hardware and software integration and collaboration
 Integration of external software and the system

1. Recovery testing
Recovery Testing is a crucial aspect of software testing focused on ensuring
that applications can recover quickly and effectively from crashes, failures, and
unexpected interruptions. This type of testing verifies the software’s
robustness and its ability to restore operations after a malfunction.

Types of Recovery Testing


 Database Recovery Testing
 Load and Stress Recovery Testing:
 Crash Recovery Testing:
 Security Recovery Testing: .
 Data Recovery Testing:
 Environment Recovery Testing:

2. Security testing
Security Testing is a type of Software Testing that uncovers vulnerabilities in
the system and determines that the data and resources of the system are protected
from possible intruders. It ensures that the software system and application are
free from any threats or risks that can cause a loss.

Major Focus Areas in Security Testing


 Network Security
 System Software Security
 Client-side Application Security
 Server-side Application Security

3. Stress testing
Stress Testing is a software testing technique that determines the
robustness of software by testing beyond the limits of normal operation. Stress
testing is particularly important for critical software but is used for all types of
software.

Types of Stress Testing


 Server-client Stress Testing
 Product Stress Testing
 Transactional Stress Testing
 Systematic Stress Testing
 Analytical Stress Testing

4. Performance testing
Performance testing is a type of software testing that focuses on evaluating
the performance and scalability of a system or application. Performance testing
aims to identify bottlenecks, measure system performance under various loads and
conditions.

Types of performance testing


 Load testing
 Stress testing
 Spike testing
 Soak testing
 Endurance testing
 Volume testing
 Scalability testing

Integration testing
Integration testing is the process of testing the interface between two
software units or modules. It focuses on determining the correctness of the
interface. The purpose of integration testing is to expose faults in the interaction
between integrated units. Once all the modules have been unit-tested, integration
testing is performed.
The integration testing can be carried out using two approaches
 The non-incremental integration
 Incremental integration
Big Bang Integration Testing
Big bang integration testing is a testing approach where all components or
modules are integrated and tested as a single unit. This is done after all modules
have been completed and before any system-level testing is performed. This is in
contrast to incremental integration testing, in which components are tested one at a
time or in small groups

Top Down integration testing


 Top down testing is an incremental approach in which modules are
integrated by moving down through the control structure
 Module subordinate to the main control module are incorporated into the
system in either a depth first or breadth first manner

 Integration process can be performed using following steps


1. The main control module is used as a test driver and the stubs are
substituted for all the modules directly subordinate to the main control
module
2. Subordinate stubs are replaced one at a time with actual modules
using either depth first or breadth first method
3. Tests are conducted as each model is integrated
4. On completion of each set of tests, another stub is replaced with the
real model

Bottom Up integration testing


In bottom up integration the modules at the lowest levels are integrated at
first, then integration is done by moving upward through the control structure.
The bottom up integration process can be carried out using following steps
1. Low level modules are combined into clusters plasters that a platform a
specific sotware subfunction
2. A driver program is written to co-ordinate test case input and output t
3. The whole cluster is tested
4. Drivers are removed and clusters are combined moving upward in the
program structure

S.No Top-down Integration Bottom-up Integration


1. The major controls or decisions After integrating all the components
are verified at early stage itself at the bottom level, major controls or
decisions can be verified
2. Testing can be performed from the Individual components can be tested
early stage at higher leve,l but after integration
of low level components into cluster
testing is required
3. In top-down testing, testing stubs In Bottom-up testing test drivers are
are created required
4 working systems can be available working systems is available only
at early stage after integration all the components

You might also like