Sqat Unit III Notes
Sqat Unit III Notes
UNIT - III
REGRESSION TESTING
❖ REGRESSION TESTING
● Regression testing is performed when changes are made to existing software; the
purpose of regression testing is to provide confidence that the newly introduced changes
do not obstruct the behaviours of the existing, unchanged part of the software.
● It is a complex procedure that is all the more challenging because of some of the recent
trends in software development.
● Regression testing is the process of re-testing the modified parts of the software and
ensuring that no new errors have been introduced into previously tested source code
due to these modifications.
● Therefore, regression testing tests both the modified source code and other parts of
the source code that may be affected by the change. It has some purposes like: -
5) Scheduling Tests
Once all the test components are identified, the opportune time for execution can be
scheduled.
❖ WHAT IS RISK?
● Risk is an expectation of loss, a potential problem that may or may not occur in the
future. It is generally caused due to lack of information, control or time.
● Loss can be anything, increase in production cost, development of poor-quality
software, not being able to complete the project on time.
● Risk is defined as the “probability of occurrence of an undesirable event and the
impact of occurrence of that event.”
Risk Analysis
● Unexpected behaviours of a software programme always carry huge information and
most of the time they disturb every associate person. No one likes such unexpected
behaviour from the software. In practice, the situation is entirely different and
developers need to face such unexpected situations frequently and work hard to find
the solutions of the problems highlighted by these unexpected behaviours.
● Risk analysis is a process of identifying the potential problems and then assigning a
‘Probability of occurrence of the problem’ value and ‘impact of that problem’ value for
each identified problem.
● A factor ‘risk exposure’ is calculated for every problem which is the product of
‘probability of occurrence of the problem’ value and ‘impact of that problem’ value.
Risk Matrix
● Risk matrix is used to capture identified problems, estimate their probability of
occurrence with impact and rank the risks based on this information.
● We may use the risk matrix to assign thresholds (Meaning-the level at which
something starts to happen) that group the potential problems into priority categories.
● The risk matrix is shown in Figure with four quadrants. Each quadrant represents a
priority category.
Threshold by quadrant: -
The priority category in defined as:
Priority category 1 (PC-1) = High probability value and high impact value
Priority category 2 (PC-2) = High probability value and low impact value
Priority category 3 (PC-3) = Low probability value and high impact value
Priority category 4 (PC-4) = Low probability value and low impact value
● In this case, a risk with high probability value is given more importance than a
problem with high impact value.
● We may change this and may decide to give more importance to high impact value
over the high probability value.
1) Statement Coverage
● The main purpose of Statement Coverage is to cover all the possible paths, lines and
statements in source code.
● It is a white box testing technique in which all the executable statements in the source
code are executed at least once.
● It is used for calculation of the number of statements in source code which have been
executed.
2) Decision Coverage
● Decision Coverage is a white box testing technique which reports the true or false
outcomes of each Boolean expression of the source code.
● The goal of decision coverage testing is to cover and validate all the accessible source
code by checking and ensuring every possible decision point is executed at least once.
3) Branch Coverage
● Branch Coverage is a white box testing method in which every outcome from a code
module (statement or loop) is tested.
● The purpose of branch coverage is to ensure that each decision condition from every
branch is executed at least once. It helps to measure independent code segments and
to find out sections having no branches.
Inheritance
OOD allows similar classes to stack up in a hierarchical manner where the lower or
sub-classes can import, implement, and re-use allowed variables and functions from
their immediate super classes. This property of OOD is called an inheritance. This
makes it easier to define a specific class and to create generalized classes from specific
ones.
Polymorphism
Encapsulation
●Encapsulation is also known as information hiding concept. It is a way in which both
data and functions (or operations) that operate on data are combined into a single unit.
● The only way to access the data is through functions, which operate on the data. The
data is hidden from the external world. Hence, it is safe from outside (external) and
accidental modifications.
What is a Unit?
● A unit is a smallest software component that can be complied and executed. A unit is
a software component that would never be assigned to more than one designer to
develop.
● In unit testing, the individual classes are tested. It is seen whether the class attributes
are implemented as per design and whether the methods and the interfaces are error-
free.
● The purpose of unit testing is to ensure that each unit meets its specification. If each
unit meets its specification, then any bugs that appear when units are integrated
together are more likely caused by incorrect interfacing of units than by incorrect
implementations of the units.
Levels of Testing
The various testing levels are:
1) Method testing
2) Class testing
3) Inter-class testing
4) System testing
5) Functionality testing
1) Method testing
● In this level the individual methods are tested to ensure that they are working as they
are intended to by the specification.
● The intended testing is just for one method, it may be that other methods and variables
may have to be included in the testing, to facilitate the testing of current method.
● This might be the case for instance if you are testing a method that calls one or more
other methods within the same class.
● This brings up the need for stub, which are replacements for the real
methods/variables which are often static in nature and simply return values that are
known to be true by the tester.
2) Class testing
● Class is tested as a whole, with each of the methods being tested to ensure when a
class is quickly that the methods work correctly with the given inputs.
● For each class, we must decide whether to test it independently as a unit or in some
way as a component of a larger part of the system.
We base that decision on the following factors:
● The role of the class in the system, especially the degree of risk associated with it.
● The complexity of the class measured in terms of the number of states, operations,
and associations with other classes.
● The amount of effort associated with developing a test driver for the class.
● Class testing should be performed prior to the use of the class in other portions of
the software.
3) Inter-class testing
● The focus of the testing at this level is in finding errors in classes. Faults which are
caused during communication between different classes are identified. It also ensures
that there is a minimum chance of these faults in system testing.
● One of the main aims is to find errors that can only be found when dealing with the
application as a whole.
● Another aim of this testing is to ensure that the application that has finally been
developed have all the functionality required as per the specification from the view point
of an end user.
4) System testing
● System testing is independent of system implementation. A system tester does really
need to know if the implementation is in procedural or object-oriented code.
● System testing involves testing the system as a whole and is the responsibility of the
quality-assurance team.
● The team often uses system tests as regression tests when assembling new releases.
● This involves testing a particular module or a subsystem and is the responsibility of
the subsystem lead. It involves testing the associations within the subsystem as well as
the interaction of the subsystem with the outside.
NOTE: - You should study and write 1,2,3 points description in the examination.
❖ PATH TESTING
● Path testing is a structural testing method that involves using the source code of a
program to attempt to find every possible executable path.
● The idea is to test each individual path in as many ways as possible in order to
maximise the coverage of each test case. This gives the best possible chance of
discovering all faults within a piece of code.
● The fact that path testing is based upon the source code of a program means that it
is a white box testing method.
Activity Diagram
● The first step of path testing is to convert source code into its activity diagram. In
Unified Modelling Language (UML), activity diagram is used to represent sequences in
which all activities are performed. This is similar to a flow graph of path testing.
● Activity diagram may be generated from a use case or from a class. It may represent
basic flow and also possible alternative flows.
● An activity diagram represents the flow of activities through the class. It provides the
basis for the path testing where we may like to execute each independent path of the
activity diagram at least once.
State 1
Event [guard]/action
B [ x<y]/previous
A[x>y]/next
State 2
Terminologies used in state chart diagram
Terminologies used in
Sr. No. Description Remarks
state chart diagram
Abstract situation in the life State1, state2
1 State cycle of an entity that occurs in
response to occurrence of some
event.
There are four events new, push, pop and destroy, with the following purposes: