*****************************************************************************
* CTC++, Test Coverage Analyzer for C/C++, Version 6.5 *
* *
* EXECUTION PROFILE LISTING *
* *
* Copyright (c) 1993-2008 Testwell Oy *
*****************************************************************************
Symbol file(s) used : MON.sym (Thu Feb 07 13:59:53 2008)
Data file(s) used : MON.dat (Thu Feb 07 14:03:02 2008)
Listing produced at : Thu Feb 07 14:03:34 2008
Coverage view : As instrumented
MONITORED SOURCE FILE : calc.c
INSTRUMENTATION MODE : function-decision-multicondition-timing
START/ END/
TRUE FALSE LINE DESCRIPTION
=============================================================================
3 0 4 FUNCTION is_prime()
1 2 8 if (val == 1 || val == 2 || val == 3)
0 - 8 T || _ || _
1 8 F || T || _
0 - 8 F || F || T
2 8 F || F || F
1 9 return 1
1 1 10 if (val % 2 == 0)
1 11 return 0
0 1 - 12 for (;divisor < val / 2;)
0 0 - 14 if (val % divisor == 0)
0 - 15 return 0
1 17 return 1
***TER 65 % ( 11/ 17) of FUNCTION is_prime()
-----------------------------------------------------------------------------
***TER 65 % ( 11/ 17) of SOURCE FILE calc.c
-----------------------------------------------------------------------------
MONITORED SOURCE FILE : io.c
INSTRUMENTATION MODE : function-decision-multicondition-timing
START/ END/
TRUE FALSE LINE DESCRIPTION
=============================================================================
4 0 5 FUNCTION io_ask()
0 4 - 11 if (( amount = scanf ( "%u" , & val ) ) <= 0)
4 14 return val
***TER 75 % ( 3/ 4) of FUNCTION io_ask()
-----------------------------------------------------------------------------
3 3 18 FUNCTION io_report()
***TER 100 % ( 1/ 1) of FUNCTION io_report()
-----------------------------------------------------------------------------
***TER 80 % ( 4/ 5) of SOURCE FILE io.c
-----------------------------------------------------------------------------
MONITORED SOURCE FILE : prime.c
INSTRUMENTATION MODE : function-decision-multicondition-timing
START/ END/
TRUE FALSE LINE DESCRIPTION
=============================================================================
1 0 8 FUNCTION main()
3 1 12 while (( prime_candidate = io_ask ( ) ) > 0)
2 1 14 if (is_prime ( prime_candidate ))
16 else
1 19 return 0
***TER 100 % ( 6/ 6) of FUNCTION main()
-----------------------------------------------------------------------------
***TER 100 % ( 6/ 6) of SOURCE FILE prime.c
-----------------------------------------------------------------------------
SUMMARY
=======
Number of monitored source files : 3
Number of source lines : 59
Number of measurement points : 30
TER : 75% (multicondition)
The two leftmost colums are execution counters. The code locations that have not been exercised in the test runs are marked with a '-' character. The points where CTC++ has made instrumentation are shown with a line number and a description what there is on the line.
In the file calc.c on line 8 we see how CTC++ reports a multicondition coverage. On that line the conditional expression contained three elementary conditions connected with the logical || operator. There is a detailed analysis how many times each of the possible combinations to evaluate the expression has actually been evaluated and did the overall decision evaluate to true or false. Had the file been instrumented with only decision coverage or had the condition expression been simple, the reporting is as shown in the file calc.c on lines 10, 12 and 14.
TER stands for Test Effectiveness Ratio. It is a percentage of the essential code locations that should have been visited from the perspective of throrough testing.
In ctcpost there are options to get the report of selected files
only. Also it can be reported in "lower level" (e.g. multicondition
coverage
reported as condition coverage, as decision coverage or as function
coverage).