Changes between Version 9 and Version 10 of Developer/Coverage/Theory
- Timestamp:
- 09/10/09 23:48:59 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Developer/Coverage/Theory
v9 v10 16 16 * '''Object Coverage''' - Has each line of generated assembly been executed? 17 17 18 In order to illustrate what is covered by each of the different criteria, consider the following simple example18 In 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. 19 19 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 29 26 branch if FALSE to do something 30 cmp y, 0 27 |- 28 | || || A2 || cmp y, 0 31 29 branch if TRUE around do something 32 do something instructions 33 }}} 30 |- 31 | B || do something || B|| do something instructions 32 |- 33 |} 34 34 = Statement Coverage = 35 35 36 36 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.37 Statement 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. 38 38 = Decision Coverage = 39 39 40 40 41 TBD 41 Decision 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 42 = MC/DC = 43 43 44 44 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? 46 46 = Object Coverage = 47 47 48 48 49 TBD 49 Object 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. 50 50 = Criteria Relationships = 51 51