MCDC MCDC 4 MCDC is a structural coverage






















- Slides: 22
MC/DC
MC/DC 4 MC/DC is a structural coverage that ensures: 4 That decisions take true and false values 4 That conditions are exercised independently 4 If ( A or C ) “A or C” is the decision, “A” & “C” are the conditions 4 The independence is also called the “unique cause”, but it cannot be always shown due to masking problem 4 There is a way to resolved it 2 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
The 5 steps method (Nasa) 4 Create a representation of the source/logic 4 Indentify the test inputs from requirements-based tests 4 Eliminate masked test case 4 Determine MC/DC based on blocks specificities (And, or, if, …) 4 Examine 3 outputs of the tests to confirm correct operation © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
The And Gate a c b 4 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
The And Gate a b 5 1 T T © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary c
The And Gate a b 6 1 2 T F T T © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary c
The And Gate a b 7 1 2 3 T F F T T F © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary c
The And Gate a b 1 2 3 4 T F F T 1 2 3 4 T F F F T T F F 8 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary c
Minimun Set of Test a b 1 2 3 4 T F F T 1 2 3 4 T F F F T T F F 9 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary c
Or Gate : Minimun Set of Test a 1 2 3 F F T 1 2 3 F T T b F T F 10 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary c
Example of logic, with its inputs from req 11 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Reporting tests 1 2 3 4 5 T F F T T T F 1 2 3 4 5 T F F F T T F 12 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary 1 2 3 4 5 T F T T F
Identifying masked case 1 2 3 4 5 T F F T T T F 1 2 3 4 5 T F F F T T F 13 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary 1 2 3 4 5 T F T T F
Determination of MC/DC : AND 1 2 3 4 5 T F F T T T F 1 2 3 4 5 T F F T F 1 2 3 4 5 T F T T F F F T T F Unmasked case provide MC/DC for “AND” 14 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Determination of MC/DC: OR 1 2 3 4 5 T F F T T T F 1 2 3 4 5 T F F T F 1 2 3 4 5 T F T T F F F T T F Case 1, 3 and 2 or 5 provide MC/DC for “OR” 15 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Output confirmation 1 2 3 4 5 T F F T T T F 1 2 3 4 5 T F F F T T F Case 1, 2, 3 satisfy MC/DC. Test 4 doest not contribute 16 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary 1 2 3 4 5 T F T T F
Using Expressions a X > 30 c b Test Case Condition X = 30 F X = 31 T X=0 F X = 100 T … 17 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Unique Cause vs Masking 18 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
MC/DC of gates 4 There 19 is no missing tests © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Changing test case: impact 4 Changing 20 test case 2 from FTFT to TFFT © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Result In Ex 2 A, only D changes, while in Ex 2, A & B also changes 4 Either “unique cause” or “masking” approaches detects the same errors 4 21 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary
Black-Box Testing 4 What if black-box testing ? 4 That is, not visibility on the code 4 Then : 4 Either the requirements are sufficiently explicit & close to the code, that is: the requirements and code represent exactly the same logical function OK 4 There is a difference. In which case, you need to ask help from dev, knowing that they should not provide exactly the example or the logic… 22 © Esterel Technologies - An ISO 9001: 2008 Certified Company - Confidential & Proprietary