Additional Statements
Test RealTime - User Guide
}
public static int method1( int _selector )
{
if( _selector < 0 ) return 0;
switch( _selector )
{
case 1: return 0;
case 2: break;
case 3: case 4: case 5: return 1;
}
return (_selector/2);
}
public static void main( String[] argv )
{
method0( 3 );
System.out.println("Value:"+method1( 5 ));
System.exit( 0 );
}
}
At least two branches per Java method are defined. The input is always enumerated,
as is the output if it can be covered.
Potentially Terminal Statements
The following decision statements are potentially terminal if they contain at least one
statement that transfers program control out of its sequence (RETURN, THROW,
GOTO, BREAK, CONTINUE) or that terminates the execution (EXIT).
·
IF without an ELSE
·
SWITCH, FOR
·
WHILE or DO...WHILE
Additional Statements
Non-coverable Statements in Java
A Java statement is
non coverable
if the statement can never possibly be executed.
Code Coverage detects non-coverable statements during instrumentation and
produces an error message that specifies the source file and line location of each non-
coverable statement.
-
Code Coverage Viewer
The Code Coverage Viewer allows you to view code coverage reports generated by
the Code Coverage feature. Select a tab at the top of the Code Coverage Viewer
window to select the type of report:
·
A Source Report, showing the source code under analysis, highlighted with the
actual coverage information.
54