Sase Module 5
Sase Module 5
SASE module 5
1
St.Antony’s College,Pervanthanam Dept.of Computer Science
Module 5
Software Testing
What is testing
Software testing is a process, to evaluate the functionality of a software
application with an intent to find whether the developed software met the
specified requirements or not and to identify the defects to ensure that the
product is defect-free in order to produce a quality product.
Definition
In software testing, a bug is the informal name of defects, which means that
software or application is not working as per the requirement.
Defect
In other words, we can say that the bug announced by the programmer and
inside the code is called a Defect.
Error
The Problem in code leads to errors, which means that a mistake can occur
due to the developer's coding error as the developer misunderstood the
requirement or the requirement was not defined correctly.
The developers use the term error.
BCA SE-Module 5
2
St.Antony’s College,Pervanthanam Dept.of Computer Science
fault
o Lack of resources
o An invalid step
o Inappropriate data definition
Failure
we can say that if an end-user detects an issue in the product, then that
particular issue is called a failure.
BCA SE-Module 5
3
St.Antony’s College,Pervanthanam Dept.of Computer Science
Verification:
Verification is the process of checking that a software achieves its goal
without any bugs. It is the process to ensure whether the product that is
developed is right or not. It verifies whether the developed product fulfills
the requirements that we have. Verification is Static Testing.
BCA SE-Module 5
4
St.Antony’s College,Pervanthanam Dept.of Computer Science
Validation:
BCA SE-Module 5
5
St.Antony’s College,Pervanthanam Dept.of Computer Science
Verification Validation
It consists of checking of
documents/files and is performed It consists of execution of program
by human. and is performed by computer.
Acceptance testing
Acceptance testing is formal testing based on user requirements and
function processing. It determines whether the software is conforming
specified requirements and user requirements or not. It is conducted as a
kind of Black Box testing where the number of required users involved
testing the acceptance level of the system. It is the fourth and last level of
software testing.
Alpha Testing
BCA SE-Module 5
6
St.Antony’s College,Pervanthanam Dept.of Computer Science
Alpha testing needs lab environment, and usually, the testers are an
internal employee of the organization. This testing is called alpha because it
is done early on, near the end of the software development, but before beta
testing.
Beta Testing
Beta testing reduces product failure risks and increases the quality of the
product through customer validation. Direct feedback from customers is a
significant advantage of beta testing.
BCA SE-Module 5
7
St.Antony’s College,Pervanthanam Dept.of Computer Science
Functional Testing:
It is a type of software testing which is used to verify the functionality of
the software application, whether the function is working according to the
requirement specification. In functional testing, each function tested by
giving the value, determining the output, and verifying the actual output
with the expected value. Functional testing performed as black-box testing
which is presented to confirm that the functionality of an application or
system behaves as we are expecting. It is done to verify the functionality of
the application.
BCA SE-Module 5
8
St.Antony’s College,Pervanthanam Dept.of Computer Science
Boundary values are those that contain the upper and lower limit of a
variable. Assume that, age is a variable of any function, and its minimum
value is 18 and the maximum value is 30, both 18 and 30 will be considered
as boundary values. Boundary Value Analysis is also called range
checking.
There is 18 and 30 are the boundary values that's why tester pays more
attention to these values, but this doesn't mean that the middle values like
19, 20, 21, 27, 29 are ignored. Test cases are developed for each and every
value of the range.
BCA SE-Module 5
9
St.Antony’s College,Pervanthanam Dept.of Computer Science
1. Any Number greater than 10 entered in the Order Pizza field(let say
11) is considered invalid.
2. Any Number less than 1 that is 0 or below, then it is considered
invalid.
3. Numbers 1 to 10 are considered valid
4. Any 3 Digit Number say -100 is invalid.
We cannot test all the possible values because if done, the number of test
cases will be more than 100. To address this problem, we use equivalence
partitioning hypothesis where we divide the possible values of tickets into
groups or sets as shown below where the system behavior can be
considered the same.
BCA SE-Module 5
10
St.Antony’s College,Pervanthanam Dept.of Computer Science
BCA SE-Module 5
11
St.Antony’s College,Pervanthanam Dept.of Computer Science
Following steps are used to identify the test cases with decision
tables:
Step – 1: For a module, identify input conditions (causes) and action
(effect).
Step – 2: Develop a cause-effect graph.
Step – 3: Transform this cause-effect graph to a decision table.
Step – 4: Convert decision table rules to test cases.
Each column of the decision table represents a test case.
BCA SE-Module 5
12
St.Antony’s College,Pervanthanam Dept.of Computer Science
1. Division of specification:
Since it is difficult to work with cause-effect graphs of large
specifications as they are complex, the specifications are divided into
small workable pieces and then converted into cause-effect graphs
separately.
2. Identification of cause and effects:
This involves identifying the causes(distinct input conditions) and
effects(output conditions) in the specification.
3. Transforming the specifications into a cause-effect graph:
The causes and effects are linked together using Boolean expressions
to obtain a cause-effect graph. Constraints are also added between
causes and effects if possible.
4. Conversion into decision table:
The cause-effect graph is then converted into a limited entry decision
table. If you’re not aware of the concept of decision tables
5. Deriving test cases:
Each column of the decision-table is converted into a test case.
The following notations are always used between a cause and an effect:
1. Identity Function: if c is 1, then e is 1. Else e is 0.
BCA SE-Module 5
13
St.Antony’s College,Pervanthanam Dept.of Computer Science
BCA SE-Module 5
14
St.Antony’s College,Pervanthanam Dept.of Computer Science
Mutation Testing
The changes made in the mutant program should be kept extremely small
that it does not affect the overall objective of the program. Mutation Testing
is also called Fault-based testing strategy as it involves creating a fault in
the program and it is a type of White Box Testing
Control flow testing is a testing technique that comes under white box
testing. The aim of this technique is to determine the execution order of
statements or instructions of the program through a control structure. The
control structure of a program is used to develop a test case for the
BCA SE-Module 5
15
St.Antony’s College,Pervanthanam Dept.of Computer Science
Control Flow Graph is formed from the node, edge, decision node, junction
node to specify all possible execution path.
1. Node
2. Edge
3. Decision Node
4. Junction node
It is concerned with:
• Statements where variables receive values,
• Statements where these values are used or referenced.
BCA SE-Module 5
16
St.Antony’s College,Pervanthanam Dept.of Computer Science
Data Flow Testing uses the control flow graph to find the situations that
can interrupt the flow of the program. Anomalies in the flow of the data
are detected at the time of associations between values and variables.
These anomalies are:
• A variable is defined but not used or referenced,
• A variable is used but never defined,
• A variable is defined twice before it is used
Path testing
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. In this method Cyclomatic
Complexity is used to determine the number of linearly independent
paths and then test cases are generated for each path.
BCA SE-Module 5
17
St.Antony’s College,Pervanthanam Dept.of Computer Science
BCA SE-Module 5
18
St.Antony’s College,Pervanthanam Dept.of Computer Science
BCA SE-Module 5
19
St.Antony’s College,Pervanthanam Dept.of Computer Science
Example
BCA SE-Module 5
20
St.Antony’s College,Pervanthanam Dept.of Computer Science
After the generation of the control flow graph, calculate the cyclomatic
complexity of the program using the following formula.
McCabe's Cyclomatic Complexity = E - N + 2P
Where,
E = Number of edges in control flow graph
N = Number of vertices in control floe graph
P = number of connected components.
Second step in path testing is to draw a dd graph from the flow graph.The
nodes of the flow graph which are in sequences are combined into a single
node in DD graph
BCA SE-Module 5
21
St.Antony’s College,Pervanthanam Dept.of Computer Science
1 1,2
2
3
6 4,5
6 4
5 7,8
7
DD Path graph
8
Flow graph
Independent Path
The independent path traces the edges in the flow graph that are not
traversed before the path is defined.
BCA SE-Module 5
22
St.Antony’s College,Pervanthanam Dept.of Computer Science
As in the above flow graph, we can observe that the starting or the first
node or procedural statement is node 1 and the termination of the flow
graph is node 11. So, all the independent path that can be traced in the flow
graph should start from 1 and end to 11:
Path 1: 1-11
Path 2: 1-2-3-4-5-10-1-11
Path 3: 1-2-3-6-8-9-10-1-11
Path 4: 1-2-3-6-7-9-10-1-11
Path 1, 2, 3 & 4 are the independent paths as each path introduces a new
edge i.e. all the paths are unique.
Graph Matrix
A graph matrix is a square matrix whose size represents the number of
nodes in the control flow graph. Each row and column in the matrix
identifies a node and the entries in the matrix represent the edges or links
between these nodes. Conventionally, nodes are denoted by digits and
edges are denoted by letters.
Let’s take an example.
Let’s convert this control flow graph into a graph matrix. Since the graph
has 4 nodes, so the graph matrix would have a dimension of 4 X 4. Matrix
entries will be filled as follows:
BCA SE-Module 5
23
St.Antony’s College,Pervanthanam Dept.of Computer Science
Unit Testing
Unit Testing is a software testing technique by means of which individual
units of software i.e. group of computer program modules, usage
procedures and operating procedures are tested to determine whether
they are suitable for use or not. It is a testing method using which every
independent modules are tested to determine if there are any issue by the
developer himself.
BCA SE-Module 5
24
St.Antony’s College,Pervanthanam Dept.of Computer Science
the units that are integrated together. System testing detects defects
within both the integrated units and the whole system
System Testing is carried out on the whole system in the context of either
system requirement specifications or functional requirement
specifications or in the context of both. System testing tests the design and
behavior of the system and also the expectations of the customer.
Validation Testing
The process of evaluating software during the development process or at
the end of the development process to determine whether it satisfies
specified business requirements.
Validation Testing ensures that the product actually meets the client's
needs. It can also be defined as to demonstrate that the product fulfills its
intended use when deployed on appropriate environment.
It answers to the question, Are we building the right product?
BCA SE-Module 5