Example of CTC++ Execution Profile Listing / Condition Coverage View

*****************************************************************************
*           CTC++, Test Coverage Analyzer for C/C++, Version 8.2            *
*                                                                           *
*                         EXECUTION PROFILE LISTING                         *
*                                                                           *
*                    Copyright (c) 1993-2013 Testwell Oy                    *
*             Copyright (c) 2013-2017 Verifysoft Technology GmbH            *
*****************************************************************************

Symbol file(s) used   : MON.sym (Tue Apr 11 13:56:19 2017)
Data file(s) used     : MON.dat (Tue Apr 11 13:56:36 2017)
Listing produced at   : Tue Apr 11 14:02:23 2017
Coverage view         : Reduced to condition coverage
 
MONITORED SOURCE FILE : F:\ctcwork\v82\doc\examples\prime.c
INSTRUMENTATION MODE  : multicondition
 HITS/TRUE      FALSE    LINE DESCRIPTION
=============================================================================
         1                  8 FUNCTION main()
         3          1      12   while (( prime_candidate = io_ask ( ) ) > 0)
         2          1      14     if (is_prime ( prime_candidate ))
                           15     }+
                           16     else
                           17     }+
                           18   }+
         1                 19   return 0
                           20 }
***TER 100 % (  6/  6) of FUNCTION main()
       100 % (  6/  6) statement
-----------------------------------------------------------------------------

***TER 100 % (  6/  6) of FILE F:\ctcwork\v82\doc\examples\prime.c
       100 % (  6/  6) statement
-----------------------------------------------------------------------------
 
MONITORED SOURCE FILE : F:\ctcwork\v82\doc\examples\io.c
INSTRUMENTATION MODE  : multicondition
 HITS/TRUE      FALSE    LINE DESCRIPTION
=============================================================================
         4                  5 FUNCTION io_ask()
         0          4 -    11   if (( amount = scanf ( "%u" , & val ) ) <= 0)
                           13   }+
         4                 14   return val
                           15 }
***TER  75 % (  3/  4) of FUNCTION io_ask()
        83 % (  5/  6) statement
-----------------------------------------------------------------------------
         3                 18 FUNCTION io_report()
         3                 21 }
***TER 100 % (  2/  2) of FUNCTION io_report()
       100 % (  1/  1) statement
-----------------------------------------------------------------------------

***TER  83 % (  5/  6) of FILE F:\ctcwork\v82\doc\examples\io.c
        86 % (  6/  7) statement
-----------------------------------------------------------------------------
 
MONITORED SOURCE FILE : F:\ctcwork\v82\doc\examples\calc.c
INSTRUMENTATION MODE  : multicondition
 HITS/TRUE      FALSE    LINE DESCRIPTION
=============================================================================
         3                  4 FUNCTION is_prime()
         1          2       8   if (val == 1 || val == 2 || val == 3)
         0          3 -     8     COND (val == 1)
         1          2       8     COND (val == 2)
         0          2 -     8     COND (val == 3)
         1                  9     return 1
                            9   }+
         1          1      10   if (val % 2 == 0)
         1                 11     return 0
                           11   }+
         0          1 -    12   for (;divisor < val / 2;)
         0          0 -    14     if (val % divisor == 0)
         0            -    15       return 0
                           15     }-
                           16   }+
         1                 17   return 1
                           18 }
***TER  68 % ( 13/ 19) of FUNCTION is_prime()
        82 % (  9/ 11) statement
-----------------------------------------------------------------------------

***TER  68 % ( 13/ 19) of FILE F:\ctcwork\v82\doc\examples\calc.c
        82 % (  9/ 11) statement
-----------------------------------------------------------------------------
 
SUMMARY
=======
Source files       : 3
Headers extracted  : 0
Functions          : 4
Source lines       : 59
TER                : 77 % (24/31) condition
TER                : 88 % (21/24) statement

This Execution Profile Listing has been generated by ctcpost -fc option (force condition coverage view). The difference shows at file calc.c on line 8. I.e. when in multicondition instrumented code of complex condition expressions there are shown how many times each evaluation alternative was executed, in this view it is shown how many times each elementary condition was true and false. Into TER% calculation it is taken: the overall condition expression has been evaluated to true and false and each elementary condition has been evaluated to true and false. The underlying code has been instrumented for multicondition coverage. There is no instrumentation mode for condition coverage.