International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056
Volume: 03 Issue: 09 | Sept-2016 www.irjet.net p-ISSN: 2395-0072
© 2016, IRJET | Impact Factor value: 4.45 | ISO 9001:2008 Certified Journal | Page 517
An Empirical based Object Oriented Coverage Analysis
Using XML
Sasanko Sekhar Gantayat, Srinivas Prasad, K. Koteswar Rao
Department of Computer Science & Engineering,
GMR Institute of Technology, Rajam, Andhra Pradesh, India.
sgantayat67@gmail.com,
1
srinivas.prasad@gmrit.org, koteswarrao.k@gmrit.org
Abstract: Testing of Object-oriented software has a
number of features that make it different from
conventional software testing. With the increase in size
and complexity of modern software products, the
importance of testing is rapidly growing. In this paper, a
new methodology is proposed to evaluate the code
coverage, its effectiveness and compared its advantages
over other traditional techniques.
Keywords: Test Coverage, Object Oriented Coverage,
Coverage Measure, Test Coverage Tools, XML.
1. Introduction to Test Coverage
Test Coverage is the process of identifying the extent to
which different test suites are appropriate in accessing a
full complement of the source code in testing various
components of the system. To the management and
deployment team, it provides assurance on the
comprehensive nature of the tests and provides insight
into the areas where testing is inadequate, or where the
labor expended on releasing a product can be reduced
due to ineffective testing. It would be worthwhile to
investigate the possibility of testing based on coverage
analysis approach and study its effectiveness.
It is the process which provides a measure of how well
the test suite actually tests the software. The major
aspect of coverage analysis are[6]:
Finding areas of a program not exercised by a
set of test suites
Creating additional test cases to increase the
coverage
Determining a quantitative measure of coverage
which is an indirect measure of quality
Identifying redundant test cases that do not
increase coverage
2. Basic Coverage Measures
There are many coverage measures. Brief description
about some of the basic coverage measures are given
below [1,3,4,5,6,7,16,18]:
Statement Coverage: This measure reports the
uncovered statements as well as a percentage of
statements that are covered. It might not detect the
control faults. It tells whether the nodes in a control flow
graph (CFG) are executed or not. It can not check
whether all the branches are executed or not.
CFG: It is a graphical representation of a program, in
which each node consists of a set of statements that can
be executed sequentially and edges are labeled with
conditional statements.
Branch Coverage: It explores whether all branches are
executed or not. It checks for the edges of the CFG i.e., it
checks for all the branches that are formed with if
statement, for statement, while, do while, switch
statement and exception handlers. It is also known as
Decision coverage. It reports whether Boolean
expressions tested in control structures evaluated to
both true and false.
Decision coverage: It reports whether Boolean
expressions tested in control structures (like if
statement, while statement) are evaluated to both true
and false. The entire Boolean expression is treated as
one true or false predicate although it contains logical -
and or logical-or operators. In addition, it includes
switch-statement cases, exception handlers and
interrupts handlers.
Condition Coverage: It reports the true or false
outcome of each Boolean subexpression, separated by
logical – operators if any. It measures the subexpressions
independently of each other. This measure is similar to
Decision coverage but has better sensitivity to the
control flow.
Path Coverage: It reports whether each of the possible
paths is executed or not. A path is a unique sequence of
branches from the function entry to the exit. It is also
known as Predicate coverage. But due to the loop
structures, many variations of this measure exist. It has
two major disadvantages – the first one is the number of
paths increases exponentially to the number of branches,
the second one is that many paths are not possible to
exercise due to relationships of data.
Method Coverage: It gives information that each
method is invoked or not. In Java there are some
methods declared as abstract i.e., they do not have a
body. Therefore, this has to be taken care by the test
coverage analyzer.