Changes between Version 9 and Version 10 of Developer/Coverage/Theory


Ignore:
Timestamp:
09/10/09 23:48:59 (15 years ago)
Author:
GlennHumphrey
Comment:

Added example explanations

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Coverage/Theory

    v9 v10  
    1616 *  '''Object Coverage''' - Has each line of generated assembly been executed?
    1717
    18 In order to illustrate what is covered by each of the different criteria, consider the following simple example
     18In order to illustrate what is covered by each of the different criteria, consider the following example showing the source code for a simple if statement along with its generated pseudo-code instructions.
    1919
    20 {{{
    21 if (x || y)
    22   do something
    23 }}}
    24 
    25 along with its psuedo object code
    26 
    27 {{{
    28 cmp x, 0
     20{| border="1" style="margin: 1em auto 1em auto;text-align: left;"
     21|+
     22|-
     23|'''Block''' || '''Source Code''' || '''Block''' || '''Object Pseudo-code'''
     24|-
     25| A || if (x OR y) || A1 || cmp x, 0
    2926branch if FALSE to do something
    30 cmp y, 0
     27|-
     28| || || A2 || cmp y, 0
    3129branch if TRUE around do something
    32 do something instructions
    33 }}}
     30|-
     31| B || do something || B|| do something instructions
     32|-
     33|}
    3434= Statement Coverage =
    3535
    3636
    37 Statement coverage verifies that each line of source code in a source file is represented by generated assembly and that that assembly code is exercised.
     37Statement Coverage requires that each line of source code must be executed.  In our example, a single test case that allows the if statement to evaluate to TRUE will achieve 100% Statement Coverage.
    3838= Decision Coverage =
    3939
    4040
    41 TBD
     41Decision Coverage requires that each control structure evaluate to both TRUE and FALSE.  In our example, two test cases are required to achieve 100% Decision Coverage.  One case must allow the if statement to evaluate to TRUE and the other case must allow the if statement to evaluate to FALSE.
    4242= MC/DC =
    4343
    4444
    45 This is also known as [http://en.wikipedia.org/wiki/Modified_Condition/Decision_Coverage Modified Condition/Decision Coverage].
     45[http://en.wikipedia.org/wiki/Modified_Condition/Decision_Coverage Modified Condition/Decision Coverage] requires that every condition in a decision taken on all possible outcomes at least once? Has each condition been shown to affect that decision outcome independently?
    4646= Object Coverage =
    4747
    4848
    49 TBD
     49Object Coverage requires that each line of generated assembly been executed.  In our example, only a test case where x is FALSE and y is TRUE will achieve 100% Object Coverage.
    5050= Criteria Relationships =
    5151