Java Coverage
Test RealTime - User Guide
suppresses the implicit include mechanism in the header files. (Corresponding
source files are so included by pre-processing.)
·
Any method (even unused ones) of an instantiated template class is analyzed
and instrumented by the Instrumentor. Some compilers do not try to analyze
such unused methods. It is possible that some of these methods are not fully
compliant with C++ standards. For example, a template class with a formal
class template argument named T can contain a compare method that uses the
== operator of the T class. If the C class used for T at instantiation time does not
define an == operator, and if the compare method is never used, compilation
succeeds but instrumentation fails. In such a situation, you can declare an ==
operator for the C class or use the -instantiationmode=used Instrumentor
option.
Additional Statements
Non-coverable Statements
A C++ statement is
non-coverable
if the statement can never possibly be executed.
Code Coverage detects non-coverable statements during instrumentation and
produces a warning message that specifies the source file and line location of each
non-coverable statement.
Java Coverage
Block Coverage
When analyzing Java source code, Code Coverage can provide the following block
coverage:
·
Statement Blocks
·
Statement Blocks and Decisions
·
Statement Blocks, Decisions, and Loops
Statement Blocks
Statement blocks are the Java method blocks, blocks introduced by control
instructions:
·
THEN for IF and ELSE for IF, WHILE and DO ... WHILE blocks
·
non-empty blocks introduced by SWITCH CASE or DEFAULT statements
·
true and false outcomes of ternary expressions (
<expr>
?
<expr>
:
<expr>
)
·
TRY blocks and any associated catch handler
·
blocks following a potentially terminal statement.
Example
public class StatementBlocks
50