background image
<< Coverage Levels | Asynchronous Transfer of Control >>
<< Coverage Levels | Asynchronous Transfer of Control >>

ATC statement

Runtime Analysis
Simple blocks are the main blocks within units as well as blocks introduced by
decisions, such as:
·
then and else (elsif) of an if
·
loop...end loop blocks of a for...while
·
exit when...end loop or exit when blocks at the end of an instruction sequence
·
when blocks of a case
·
when blocks of exception processing blocks
·
do...end block of the accept instruction
·
or and else blocks of the select instruction
·
begin...exception blocks of the declare block that contain an exceptions
processing block.
·
select...then abort blocks of an ATC statement
·
sequence blocks: instructions found after a potentially terminal statement.
A simple block constitutes one branch. Each unit contains at least one simple block
corresponding to its body, except packages that do not contain an initialization block.
Decision Coverage (Implicit Blocks)
An if statement without an else statement introduces an implicit block.
-- Function power_10
-- -block=decision or -block=implicit
function power_10 ( value, max : in integer) return integer is
ret, i : integer ;
begin
if ( value == 0 ) then
return 0;
-- implicit else block
end if ;
for i in 0..9
loop
if ( (max /10) < ret ) then
ret := ret *10 ;
else
ret := max ;
end if ;
end loop ;
return ret;
end ;
An implicit block constitutes one branch.
Implicit blocks refer to simple blocks to describe possible decisions. The Code
Coverage report presents the sum of these decisions as an absolute value and a ratio.
Loop Coverage (Logical Blocks)
29