<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
code	B-Application
coverage	I-Application
is	O
a	O
percentage	O
measure	O
of	O
the	O
degree	O
to	O
which	O
the	O
source	O
code	O
of	O
a	O
program	B-Application
is	O
executed	O
when	O
a	O
particular	O
test	O
suite	O
is	O
run	O
.	O
</s>
<s>
A	O
program	B-Application
with	O
high	O
test	O
coverage	O
has	O
more	O
of	O
its	O
source	O
code	O
executed	O
during	O
testing	O
,	O
which	O
suggests	O
it	O
has	O
a	O
lower	O
chance	O
of	O
containing	O
undetected	O
software	B-Error_Name
bugs	I-Error_Name
compared	O
to	O
a	O
program	B-Application
with	O
low	O
test	O
coverage	O
.	O
</s>
<s>
Some	O
of	O
the	O
most	O
basic	O
are	O
the	O
percentage	O
of	O
program	B-Application
subroutines	O
and	O
the	O
percentage	O
of	O
program	B-Application
statements	O
called	O
during	O
execution	O
of	O
the	O
test	O
suite	O
.	O
</s>
<s>
Function	O
coveragehas	O
each	O
function	O
(	O
or	O
subroutine	O
)	O
in	O
the	O
program	B-Application
been	O
called	O
?	O
</s>
<s>
Statement	O
coveragehas	O
each	O
statement	O
in	O
the	O
program	B-Application
been	O
executed	O
?	O
</s>
<s>
Branch	O
coveragehas	O
each	O
branch	O
(	O
also	O
called	O
the	O
DD-path	B-General_Concept
)	O
of	O
each	O
control	O
structure	O
(	O
such	O
as	O
in	O
if	O
and	O
case	O
statements	O
)	O
been	O
executed	O
?	O
</s>
<s>
For	O
example	O
,	O
consider	O
the	O
following	O
C	B-Language
function	O
:	O
</s>
<s>
Assume	O
this	O
function	O
is	O
a	O
part	O
of	O
some	O
bigger	O
program	B-Application
and	O
this	O
program	B-Application
was	O
run	O
with	O
some	O
test	O
suite	O
.	O
</s>
<s>
Statement	B-Application
coverage	I-Application
for	O
this	O
function	O
will	O
be	O
satisfied	O
if	O
it	O
was	O
called	O
for	O
example	O
as	O
foo(1,1 )	O
,	O
because	O
in	O
this	O
case	O
,	O
every	O
line	O
in	O
the	O
function	O
would	O
be	O
executed	O
—	O
including	O
z	O
=	O
x	O
;	O
.	O
</s>
<s>
Branch	B-Application
coverage	I-Application
will	O
be	O
satisfied	O
by	O
tests	O
calling	O
foo(1,1 )	O
and	O
foo(0,1 )	O
because	O
,	O
in	O
the	O
first	O
case	O
,	O
both	O
if	O
conditions	O
are	O
met	O
and	O
z	O
=	O
x	O
;	O
is	O
executed	O
,	O
while	O
in	O
the	O
second	O
case	O
,	O
the	O
first	O
condition	O
,	O
(	O
x>0	O
)	O
,	O
is	O
not	O
satisfied	O
,	O
which	O
prevents	O
the	O
execution	O
of	O
z	O
=	O
x	O
;	O
.	O
</s>
<s>
Condition	O
coverage	O
does	O
not	O
necessarily	O
imply	O
branch	B-Application
coverage	I-Application
.	O
</s>
<s>
However	O
,	O
this	O
set	O
of	O
tests	O
does	O
not	O
satisfy	O
branch	B-Application
coverage	I-Application
since	O
neither	O
case	O
will	O
meet	O
the	O
if	O
condition	O
.	O
</s>
<s>
Fault	O
injection	O
may	O
be	O
necessary	O
to	O
ensure	O
that	O
all	O
conditions	O
and	O
branches	O
of	O
exception-handling	B-General_Concept
code	O
have	O
adequate	O
coverage	O
during	O
testing	O
.	O
</s>
<s>
A	O
combination	O
of	O
function	O
coverage	O
and	O
branch	B-Application
coverage	I-Application
is	O
sometimes	O
also	O
called	O
decision	O
coverage	O
.	O
</s>
<s>
This	O
criterion	O
requires	O
that	O
every	O
point	B-Language
of	I-Language
entry	I-Language
and	I-Language
exit	I-Language
in	O
the	O
program	B-Application
has	O
been	O
invoked	O
at	O
least	O
once	O
,	O
and	O
every	O
decision	O
in	O
the	O
program	B-Application
has	O
taken	O
on	O
all	O
possible	O
outcomes	O
at	O
least	O
once	O
.	O
</s>
<s>
This	O
definition	O
is	O
not	O
the	O
same	O
as	O
branch	B-Application
coverage	I-Application
,	O
however	O
,	O
the	O
term	O
decision	O
coverage	O
is	O
sometimes	O
used	O
as	O
a	O
synonym	O
for	O
it	O
.	O
</s>
<s>
However	O
,	O
for	O
safety-critical	B-Application
applications	O
(	O
such	O
as	O
avionics	B-Application
software	I-Application
)	O
it	O
is	O
often	O
required	O
that	O
modified	O
condition/decision	O
coverage	O
(	O
MC/DC	O
)	O
be	O
satisfied	O
.	O
</s>
<s>
However	O
,	O
the	O
above	O
tests	O
set	O
will	O
not	O
satisfy	O
modified	O
condition/decision	O
coverage	O
,	O
since	O
in	O
the	O
first	O
test	O
,	O
the	O
value	O
of	O
'	O
b	O
 '	O
and	O
in	O
the	O
second	O
test	O
the	O
value	O
of	O
'	O
c	B-Language
 '	O
would	O
not	O
influence	O
the	O
output	O
.	O
</s>
<s>
Failure	O
to	O
test	O
each	O
possible	O
parameter	O
value	O
may	O
result	O
in	O
a	O
bug	B-Error_Name
.	O
</s>
<s>
Testing	O
only	O
one	O
of	O
these	O
could	O
result	O
in	O
100%	O
code	B-Application
coverage	I-Application
as	O
each	O
line	O
is	O
covered	O
,	O
but	O
as	O
only	O
one	O
of	O
seven	O
options	O
are	O
tested	O
,	O
there	O
is	O
only	O
14.2	O
%	O
PVC	O
.	O
</s>
<s>
State	O
coverageHas	O
each	O
state	O
in	O
a	O
finite-state	B-Architecture
machine	I-Architecture
been	O
reached	O
and	O
explored	O
?	O
</s>
<s>
Safety-critical	B-Application
or	O
dependable	B-Application
applications	O
are	O
often	O
required	O
to	O
demonstrate	O
100%	O
of	O
some	O
form	O
of	O
test	O
coverage	O
.	O
</s>
<s>
For	O
instance	O
,	O
path	B-Application
coverage	I-Application
implies	O
decision	O
,	O
statement	O
and	O
entry/exit	O
coverage	O
.	O
</s>
<s>
Decision	O
coverage	O
implies	O
statement	B-Application
coverage	I-Application
,	O
because	O
every	O
statement	O
is	O
part	O
of	O
a	O
branch	O
.	O
</s>
<s>
Full	O
path	B-Application
coverage	I-Application
,	O
of	O
the	O
type	O
described	O
above	O
,	O
is	O
usually	O
impractical	O
or	O
impossible	O
.	O
</s>
<s>
Many	O
paths	O
may	O
also	O
be	O
infeasible	O
,	O
in	O
that	O
there	O
is	O
no	O
input	O
to	O
the	O
program	B-Application
under	O
test	O
that	O
can	O
cause	O
that	O
particular	O
path	O
to	O
be	O
executed	O
.	O
</s>
<s>
Basis	B-General_Concept
path	I-General_Concept
testing	I-General_Concept
is	O
for	O
instance	O
a	O
method	O
of	O
achieving	O
complete	O
branch	B-Application
coverage	I-Application
without	O
achieving	O
complete	O
path	B-Application
coverage	I-Application
.	O
</s>
<s>
Methods	O
for	O
practical	O
path	B-Application
coverage	I-Application
testing	O
instead	O
attempt	O
to	O
identify	O
classes	O
of	O
code	O
paths	O
that	O
differ	O
only	O
in	O
the	O
number	O
of	O
loop	O
executions	O
,	O
and	O
to	O
achieve	O
"	O
basis	O
path	O
"	O
coverage	O
the	O
tester	O
must	O
cover	O
all	O
the	O
path	O
classes	O
.	O
</s>
<s>
The	O
meaning	O
of	O
this	O
depends	O
on	O
what	O
form(s )	O
of	O
coverage	O
have	O
been	O
used	O
,	O
as	O
67%	O
branch	B-Application
coverage	I-Application
is	O
more	O
comprehensive	O
than	O
67%	O
statement	B-Application
coverage	I-Application
.	O
</s>
<s>
Generally	O
,	O
test	O
coverage	O
tools	O
incur	O
computation	O
and	O
logging	O
in	O
addition	O
to	O
the	O
actual	O
program	B-Application
thereby	O
slowing	O
down	O
the	O
application	O
,	O
so	O
typically	O
this	O
analysis	O
is	O
not	O
done	O
in	O
production	O
.	O
</s>
<s>
In	O
particular	O
,	O
some	O
race	B-Operating_System
conditions	I-Operating_System
or	O
similar	O
real	B-General_Concept
time	I-General_Concept
sensitive	O
operations	O
can	O
be	O
masked	O
when	O
run	O
under	O
test	O
environments	O
;	O
though	O
conversely	O
,	O
some	O
of	O
these	O
defects	O
may	O
become	O
easier	O
to	O
find	O
as	O
a	O
result	O
of	O
the	O
additional	O
overhead	O
of	O
the	O
testing	O
code	O
.	O
</s>
<s>
C1	O
stands	O
for	O
statement	B-Application
coverage	I-Application
and	O
C2	O
for	O
branch	O
or	O
condition	O
coverage	O
.	O
</s>
<s>
Statement	B-Application
coverage	I-Application
would	O
also	O
cover	O
function	O
coverage	O
with	O
entry	O
and	O
exit	O
,	O
loop	O
,	O
path	O
,	O
state	O
flow	O
,	O
control	O
flow	O
and	O
data	O
flow	O
coverage	O
.	O
</s>
<s>
With	O
these	O
methods	O
,	O
it	O
is	O
possible	O
to	O
achieve	O
nearly	O
100%	O
code	B-Application
coverage	I-Application
in	O
most	O
software	O
projects	O
.	O
</s>
