whiteBoxTesting

whiteBoxTesting - White-box, Structural Testing White Box...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Fal 2005 CS514 WB-1 White-box, Structural Testing Supplement to Notes 6 J. Bieman CS514 Fal 2005 CS514 WB-2 White Box Test Coverage Criteria. ± Statement or node coverage. ± Branch coverage, edge coverage, or decision coverage. ± Condition coverage. ± Definition/Use (dataflow) coverage. – All-uses – All-du-paths –… Fal 2005 CS514 WB-3 Test Coverage Strength ± Branch coverage is stronger than statement coverage, ± Condition coverage is stronger than branch coverage, and ± Definition/Use coverage is stronger than branch coverage. If tests satisfy a coverage criteria, they also satisfy all weaker ones. Fal 2005 CS514 WB-4 Example ± Look at the code: if (A) S1; S2; ± We can cover both S1 and S2 with 1 test. Just set A=true. ± To cover all branches, we must also test the path that skips S1. We need another test case where A=false. Fal 2005 CS514 WB-5 Sometimes Stronger Coverage is Needed ± Buggy code: i = 0; if (A) i = 1; x = y/i; ± No error when you test with A=true. ± Bombs if you test with A=false. Branch coverage reveals the error, but statement coverage does not! Fal 2005 CS514 WB-6 An Error, Not Detected by Branch Coverage ... if (A() & B()) x = y + z; ... boolean A() { if (F1) { q = 0; return true; } else return false; } ... boolean B() { if (F2) { q = 0; return true; } else { x = 10/q; return false; } }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Fal 2005 CS514 WB-7 We Test the Code ± Branch coverage is satisfied with 2 tests: – F1==true and F2==true: takes the true path. – F1==false and F2==false: takes the false path. ± The error occurs when F1==true & F2==false. ± Condition coverage or DU pairs (all-uses) coverage would require this test. Fal 2005 CS514 WB-8 ± Definition: the point in a program where a variables value is set or changed. ± Use: the point where a variables value is
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/29/2010 for the course CS 514 taught by Professor Prof.j.bieman during the Fall '09 term at Colorado State.

Page1 / 6

whiteBoxTesting - White-box, Structural Testing White Box...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online