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


Ignore:
Timestamp:
Sep 11, 2009, 8:30:49 PM (10 years ago)
Author:
GlennHumphrey
Comment:

Continued with explanations

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Coverage/Theory

    v10 v11  
    1313 *  '''Decision Coverage''' (also known as Branch coverage) - Has each control structure (such as an if statement) evaluated both to true and false?
    1414 *  '''Condition Coverage''' - Has each boolean sub-expression evaluated both to true and false (this does not necessarily imply decision coverage)?
    15  *  '''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?
    1615 *  '''Object Coverage''' - Has each line of generated assembly been executed?
     16= Statement Coverage =
     17
     18
     19Statement Coverage requires that each line of source code must be executed.  This is often considered the simpliest criteria.  The problem is that it only identifies the lines that were executed, and does not consider the logic flow of the code.  It can be useful for indentifying "chunks" of code (i.e. new functionality) that are not covered by the test suite, but not much else.
     20= Decision Coverage =
     21
     22
     23Decision Coverage requires that each control structure evaluate to both TRUE and FALSE.  This is a pretty good criteria because it generally ensures that both the TRUE and FALSE paths of an expression are covered.  However, expressions without an else alternative can be a problem because
     24= Condition Coverage =
     25
     26
     27TBD
     28= Object Coverage =
     29
     30
     31Object Coverage requires that each line of generated assembly been executed.
     32= An Example =
     33
    1734
    1835In 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.
     
    4057
    4158Decision 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.
    42 = MC/DC =
     59= Condition Coverage =
    4360
    4461
    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?
     62TBD
    4663= Object Coverage =
    4764