Changes between Version 5 and Version 6 of Developer/Coverage/Theory


Ignore:
Timestamp:
Sep 10, 2009, 1:15:28 AM (10 years ago)
Author:
GlennHumphrey
Comment:

Beginning to show example

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Coverage/Theory

    v5 v6  
    88The subject of Code Coverage Analysis is broad and has been written about many times over.  This background material is not intented to summerize or rehash what can be read elsewhere.  Instead, the focus here will be on the aspects of Code Coverage Analysis as they pertain to the [wiki:TBR/UserManual/RTEMS_Coverage_Analysis RTEMS Coverage Analysis] effort.
    99
    10 The ultimate goal of Code Coverage Analysis is to ensure that every line of generated assembly in a particular configuration is executed by the test suite, that the tests exercise both taking and not taking every branch, and that every line of source code is actually tested.  In order to achieve this goal, several different coverage criteria may have to be examined.  Let's consider the following criteria:
     10The ultimate goal of Code Coverage Analysis is to ensure that a test suite adequately tests a particular body of code.  In order to achieve this goal, several different coverage criteria may have to be examined.  Let's consider the following criteria:
    1111
    1212 *  '''Object coverage''' - Has each line of generated assembly been executed?
     
    1616 *  '''Modified Condition/Decision Coverage|Modified Condition/Decision Coverage (MC/DC)''' - Has every condition in a decision taken on all possible outcomes at least once? Has each condition been shown to affect that decision outcome independently?
    1717
     18Each of these criteria can be used independently to analyze the code in question.  But there are clear relationships between the different criteria as shown in the picture.  It is important
     19
    1820[[Image(CoverageCategories.png)]]]]
    1921
    20 This is beyond statement level coverage in that we have to verify both paths of a C line like the following is executed:
     22If we consider the following example
    2123
    2224{{{
    23 x = (y) ? z : a;
     25if (x || y)
     26  do something
    2427}}}
    2528
    26 That is one statement but includes a branch.  That makes it one point to cover when viewed using statement coverage.  But it is two points to cover in our object level coverage of generated assembly.
     29and its psuedo object code
     30
     31{{{
     32cmp x, 0
     33branch if FALSE to do something
     34}}}
    2735= Object Coverage =
    2836