Your SlideShare is downloading. ×
0
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Whitebox
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Whitebox

2,599

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,599
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
105
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. SOFTWARE QUALITY ASSURANCE WHITE BOX Seminar: Oana FEIDI Quality Manager – Continental Automotive
  • 2. White Box (Structural Testing) <ul><li>Structural - test case selection is based on an analysis of the internal structure of component </li></ul><ul><ul><li>Control flow </li></ul></ul><ul><ul><ul><li>Statement testing </li></ul></ul></ul><ul><ul><ul><li>Branch/Decision Testing </li></ul></ul></ul><ul><ul><ul><li>Branch Condition Testing </li></ul></ul></ul><ul><ul><ul><li>Modified Condition Combination Testing </li></ul></ul></ul><ul><ul><li>Data flow testing </li></ul></ul>
  • 3. White Box <ul><li>Using the white-box testing techniques outlined in this seminar , a software engineer can design test cases that </li></ul><ul><ul><ul><li>exercise independent paths within a module or unit; </li></ul></ul></ul><ul><ul><ul><li>e xercise logical decisions on both their true and false side; </li></ul></ul></ul><ul><ul><ul><li>execute loops at their boundaries and within their operational bounds </li></ul></ul></ul><ul><ul><ul><li>exercise internal data structures to ensure their validity </li></ul></ul></ul>
  • 4. Statement testing <ul><li>uses a model of the program’s control flow </li></ul><ul><li>it is designed in order to execute all or selected statements of the test object </li></ul>An entity in a programming language which is typically the smallest indivisible unit of execution. <ul><li>Test cases are design to execute each statement. </li></ul><ul><li>For each test case specify: </li></ul><ul><li>the input(s) of the component </li></ul><ul><li>identification of statement(s) to be executed by the test case </li></ul><ul><li>the expected outcome of the test case </li></ul>Test completeness criteria : the percentage of the statements in the software which were executed at least at once (executing a statement means that the statement was encountered and evaluated during testing).
  • 5. Example <ul><li>float foo (int a, int b, int c, int d, float e) </li></ul><ul><li>{ </li></ul><ul><li>float e; </li></ul><ul><li>if (a == 0) { </li></ul><ul><li>return 0; </li></ul><ul><li>} </li></ul><ul><li>int x = 0; </li></ul><ul><li>if ((a==b) OR ((c == d) AND bug(a) )) { </li></ul><ul><li>x=1; </li></ul><ul><li>} </li></ul><ul><li>e = 1/x; </li></ul><ul><li>return e; </li></ul><ul><li>} </li></ul>statement
  • 6. Branch/Decision Testing <ul><li>uses a model of the program’s flow </li></ul><ul><li>it is designed in order to execute (each) outcome of all or selected decision points in a test object </li></ul>an executable statement which may transfer control to another statement, depending upon the logic of the decision statement <ul><li>For each test specify: </li></ul><ul><li>the input(s) of the component </li></ul><ul><li>Identification of decision outcome(s) to be executed by the test case </li></ul><ul><li>the expected outcome of the test case </li></ul>Test completeness criteria : achievement of the test coverage – 100% of the branches (one true and one false for each part of condition)
  • 7. Example <ul><li>A = true and (B or C) = false </li></ul><ul><li>A = false and (B or C) = true </li></ul>if A and (B or C) Case A B C Output 1 0 1 1 0 2 1 0 0 0
  • 8. Branch Condition Combination <ul><li>uses a model of the program flow where each combination of the inputs for a decision/condition must be tested, in order to check if each branch is covered </li></ul><ul><li>For each test case specify: </li></ul><ul><ul><ul><li>the input(s) of the component </li></ul></ul></ul><ul><ul><ul><li>the expected outcome of the test case which can show which branch is covered </li></ul></ul></ul><ul><li>Test completeness criteria : for a condition containing n boolean operands -> 2 n test cases are required to achieve 100% coverage </li></ul><ul><li>Note: this coverage rapidly becomes unachievable for more complex conditions. </li></ul>
  • 9. Example Start if a & (b or c) End true false A = true, false B = true, false C = true, false Exercise !!! Case A B C Outcome
  • 10. White Box - summary <ul><li>Statement testing </li></ul><ul><ul><ul><li>uses a model of the program’s control flow </li></ul></ul></ul><ul><ul><ul><li>it is designed in order to execute all or selected statements of the test object </li></ul></ul></ul><ul><li>Branch/Decision Testing </li></ul><ul><ul><ul><li>uses a model of the program’s flow </li></ul></ul></ul><ul><ul><ul><li>it is designed in order to execute (each) outcome of all or selected decision points in a test object </li></ul></ul></ul><ul><li>Branch Condition Combination </li></ul><ul><ul><ul><li>uses a model of the program flow where each combination of the inputs for a decision/condition must be tested, in order to check if each branch is covered </li></ul></ul></ul>
  • 11. Can we discover the mistake? What happens if we have: IF(A AND (B AND C)) instead of IF (A AND (B OR C)) Exercise : Verify if using Branch/Decision testing and Branch Condition Combination testing we can discover the mistake.
  • 12. Modified Condition Combination Testing <ul><li>uses a model of the program’s flow where each atomic condition is independently tested, in order to show how the decision outcome is affected </li></ul><ul><li>test case are designed to show that each condition independently affects the decision outcome </li></ul><ul><li>For each test case specify: </li></ul><ul><ul><ul><li>the input(s) of the component </li></ul></ul></ul><ul><ul><ul><li>The expected outcome of the test case </li></ul></ul></ul>
  • 13. Modified Condition Combination Testing <ul><li>Test completeness criteria </li></ul><ul><ul><li>for a condition containing n boolean operands, to achieve 100% coverage are necessary: </li></ul></ul><ul><ul><ul><li>minimum: n + 1 test cases </li></ul></ul></ul><ul><ul><ul><li>maximum: 2n test cases </li></ul></ul></ul><ul><li>Example: for 3 boolean operands, to achieve 100% coverage are necessary: </li></ul><ul><ul><ul><li>Minimum 4 test cases </li></ul></ul></ul><ul><ul><ul><li>Maximum 6 test cases </li></ul></ul></ul>
  • 14. Example if (A and (B or C)) Case A B B or C C Outcome 1 1 1 1 0 1 2 0 0 3 1 1 1 0 1 4 0 0 0 5 1 0 1 1 1 6 0 0 0
  • 15. Loop Testing <ul><li>Simple Loops :- 'n' is the maximum number of allowable passes </li></ul><ul><ul><ul><li>skip the loop entirely. </li></ul></ul></ul><ul><ul><ul><li>only one pass thru the loop. </li></ul></ul></ul><ul><ul><ul><li>two passes thru the loop. </li></ul></ul></ul><ul><ul><ul><li>m passes thru the loop where m< n. </li></ul></ul></ul><ul><ul><ul><li>n-1,n,n+1 passes thru the loop </li></ul></ul></ul><ul><li>Nested loops </li></ul><ul><ul><ul><li>start with the innermost loop. Set all other loop to min. values. </li></ul></ul></ul><ul><ul><ul><li>conduct simple loop tests for the innermost loop while holding the outer loops at their min. iteration values. </li></ul></ul></ul><ul><ul><ul><li>work outward, conducting tests for the next loop, but keeping all the outer loops at their min. iteration count. </li></ul></ul></ul><ul><ul><ul><li>continue until all loops have been tested. </li></ul></ul></ul>

×