Unit-4 Dynamic Analysis (E-Next - In)
Unit-4 Dynamic Analysis (E-Next - In)
UNIT 4
DYNAMIC ANALYSIS
Black Box Testing-
Equivalence Partitioning
On the basis of the code, the input vectors of [a,b] are partitioned. The blocks we need to
cover are the overflow statement and the underflow statement and neither of these 2. That
gives rise to 3 equivalent classes, from the code review itself.
Page 30 of 88
STQA NOTES SYMCA
The testing theory related to equivalence partitioning says that only one test case of
each partition is needed to evaluate the behaviour of the program for the related
partition. In other words it is sufficient to select one test case out of each partition to
check the behaviour of the program. To use more or even all test cases of a partition
will not find new faults in the program. The values within one partition are
considered to be "equivalent". Thus the number of test cases can be reduced
considerably.
Equivalence partitioning is not a stand alone method to determine test cases. It has to
be supplemented by boundary value analysis. Having determined the partitions of
possible inputs the method of boundary value analysis has to be applied to select the
most effective test cases out of these partitions.
Page 31 of 88
STQA NOTES SYMCA
On the basis of the code, the input vectors of [a,b] are partitioned. The blocks we need to
cover are the overflow statement and the underflow statement and neither of these 2. That
gives rise to 3 equivalent classes, from the code review itself.
Page 32 of 88
STQA NOTES SYMCA
For another example, if the input values were months of the year,
expressed as integers, the input parameter 'month' might have the
following partitions:
Page 33 of 88
STQA NOTES SYMCA
State Transition testing, a black box testing technique, in which outputs are triggered by changes to
the input conditions or changes to 'state' of the system. In other words, tests are designed to
execute valid and invalid state transitions.
State transition testing is used where some aspect of the system can be described in what
is called a ‘finite state machine’. This simply means that the system can be in a (finite)
number of different states, and the transitions from one state to another are determined by
the rules of the ‘machine’. This is the model on which the system and the tests are based.
Any system where you get a different output for the same input, depending on what has
happened before, is a finite state system.
One of the advantages of the state transition technique is that the model can be as detailed
or as abstract as you need it to be. Where a part of the system is more important (that is,
requires more testing) a greater depth of detail can be modeled. Where the system is less
important (requires less testing), the model can use a single state to signify what would
otherwise be a series of different states.
A state transition model has four basic parts:
Page 34 of 88
STQA NOTES SYMCA
Example:
A System's transition is represented as shown in the below diagram:
The tests are derived from the above state and transition and below are the possible scenarios that
need to be tested.
Tests Test 1 Test 2 Test 3
Page 35 of 88
STQA NOTES SYMCA
It finds out the areas where data is collected for additional study.
It motivates team contribution and uses the team data of the process.
Uses synchronize and easy to read format to diagram cause-and-effect relationships.
It enhances facts of the procedure by helping everyone to learn more about the factors at work
and how they relate.
It Helps us to determine the root causes of a problem or quality using a structured approach.
It Uses an orderly, easy-to-read format to diagram cause-and-effect relationships.
It Indicates possible causes of variation in a process.
It Identifies areas, where data should be collected for further study.
It Encourages team participation and utilizes the team knowledge of the process.
It Increases knowledge of the process by helping everyone to learn more about the factors at
work and how they relate.
It assists us to decide the root reasons of a problem or quality using a structured approach.
Steps to proceed on Cause-Effect Diagram:
Firstly: Recognize and describe the input conditions (causes) and actions (effect)
Secondly: Build up a cause-effect graph
Third: Convert cause-effect graph into a decision table
Fourth: Convert decision table rules to test cases. Each column of the decision table represents a
test case
Page 36 of 88
STQA NOTES SYMCA
Page 37 of 88
STQA NOTES SYMCA
Benefits :
It Helps us to determine the root causes of a problem or quality using a structured approach.
It Uses an orderly, easy-to-read format to diagram cause-and-effect relationships.
It Indicates possible causes of variation in a process.
It Identifies areas, where data should be collected for further study.
It Encourages team participation and utilizes the team knowledge of the process.
It Increases knowledge of the process by helping everyone to learn more about the factors at
work and how they relate.
Page 38 of 88
STQA NOTES SYMCA
EXAMPLE
Actions/Outcomes
Page 39 of 88
STQA NOTES SYMCA
Process term Y Y
Actions/Outcomes
Process term Y Y
Error message Y
Page 40 of 88
STQA NOTES SYMCA
Actions/Outcomes
Process term Y
Error message Y Y
Documentation Testing involves testing of the documented artifacts that are usually developed
before or during the testing of Software.
Documentation for Software testing helps in estimating the testing effort required, test coverage,
requirement tracking/tracing, etc. This section includes the description of some commonly used
documented artifacts related to Software development and testing, such as:
Test Plan
Requirements
Test Cases
Traceability Matrix
It is a type of non-functional testing
As per the IEEE Documentation describing plans for, or results of, the testing of a system or
component, Types include test case specification, test incident report, test log, test plan, test
procedure, test report. Hence the testing of all the above mentioned documents is known
as documentation testing.
This is one of the most cost effective approaches to testing. If the documentation is not
right: there will be major and costly problems. The documentation can be tested in a
number of different ways to many different degrees of co mplexity. These range from
running the documents through a spelling and grammar checking device, to manually
reviewing the documentation to remove any ambiguity or inconsistency.
Documentation testing can start at the very beginning of the software process and hence
save large amounts of money, since the earlier a defect is found the less it will cost to be
fixed.
Page 41 of 88
STQA NOTES SYMCA
DOMAIN TESTING
Domain testing is a software testing technique in which selecting a small number of test cases from a
nearly infinite group of test cases. For testing few applications, Domain specific knowledge plays a
very crucial role.
Domain testing is a type of functional testing and tests the application by feeding interesting inputs
and evaluating its outputs.
Domain - Equivalence Class Testing
Equivalence class carries its own significance when performing domain testing. Different ways of
equivalence class are:
Intuitive equivalence
Specified equivalence
Subjective equivalence
Risk-based equivalence
STATEMENT COVERAGE
The statement coverage is also known as line coverage or segment coverage.
The statement coverage covers only the true conditions.
Through statement coverage we can identify the statements executed and where the code is
not executed because of blockage.
In this process each and every line of code needs to be checked and executed
In Statement Coverage testing the code is executed in such a manner that every statement
of the application is executed at least once. It helps in assuring that all the statements
execute without any side effect.This method is also called as line coverage or segment
coverage. It is one of the testing coming under white box testing.
In statement coverage testing we make sure that all of our code blocks are executed. We
can also identify which blocks are failed to execute in this method.
Still bugs may be there after executing all the blocks without any failure. Because it wont
check with all the conditions in a single block. Its only a basic testing after the complete
coding and dynamic analysis. For checking with every conditions we need to to branch and
path coverage testing.
Page 42 of 88
STQA NOTES SYMCA
BRANCH COVERAGE
Branch coverage is a testing method, which aims to ensure that each one of the possible branch
from each decision point is executed at least once and thereby ensuring that all reachable code is
executed.
That is, every branch taken each way, true and false. It helps in validating all the branches in the
code making sure that no branch leads to abnormal behavior of the application.
This metric ignores branches within boolean expressions which occur due to short-
circuit operators.
Page 43 of 88
STQA NOTES SYMCA
Formula:
Example:
Read A
Read B
ENDIF
If A > 5 THEN
ENDIF
Page 44 of 88
STQA NOTES SYMCA
Result :
To calculate Branch Coverage, one has to find out the minimum number of paths which will
ensure that all the edges are covered. In this case there is no single path which will ensure
coverage of all the edges at once. The aim is to cover all possible true/false decisions.
(1) 1A-2C-3D-E-4G-5H
(2) 1A-2B-E-4F
PATH COVERAGE
Basis path testing, a structured testing or white box testing technique used for designing test cases
intended to examine all possible paths of execution at least once. Creating and executing tests for all
possible paths results in 100% statement coverage and 100% branch coverage.
Path coverage testing is a specific kind of methodical, sequential testing in which each individual line
of code is assessed.
As a type of software testing, path coverage testing is in the category of technical test methods,
rather than being part of an overarching strategy or "philosophy" of code. It is labor-intensive and is
often reserved for specific vital sections of code.
Page 45 of 88
STQA NOTES SYMCA
Example:
1 int i;
location = array_size + 1;
2 for i = 1 to array_size
3 if ( array[i] == value )
4 location = i;
end if;
end for;
6 array[i] = array[i+1];
end for;
7 array_size --;
Page 46 of 88
STQA NOTES SYMCA
Path 1: 1 - 2 - 5 - 7
Path 2: 1 - 2 - 5 - 6 - 7
Path 3: 1 - 2 - 3 - 2 - 5 - 6 - 7
Path 4: 1 - 2 - 3 - 4 - 2 - 5 - 6 - 7
Page 47 of 88