0
SOFTWARE QUALITYASSURANCEWHITE BOX      Seminar: Oana FEIDI      Quality Manager – Continental Automotive
BLACK-BOX VS. WHITE-BOX                      Test cases derived from specifications   The focus is not the design, nor t...
WHITE BOX (STRUCTURALTESTING) Structural - test case selection is based on an analysis of the internal structure of compo...
WHITE BOX   Using the white-box testing techniques outlined    in this seminar, a software engineer can design    test ca...
STATEMENT TESTING   uses a model of the program’s control flow   it is designed in order to execute all or selected stat...
EXAMPLE float foo (int a, int b, int c, int d, float e) {    float e;    if (a == 0) {           return 0;    }    int x =...
BRANCH/DECISION TESTING uses a model of the program’s flow it is designed in order to execute (each) outcome  of all or ...
EXAMPLEA  = true and (B or C) = false A = false and (B or C) = true                                       if A and (B or...
BRANCH CONDITION COMBINATION   uses a model of the program flow where each    combination of the inputs for a decision/co...
WHITE BOX - SUMMARY Statement     testing     uses a model of the program’s control flow     it is designed in order to...
MODIFIED CONDITION COMBINATIONTESTING usesa model of the program’s flow where each atomic condition is independently test...
MODIFIED CONDITION COMBINATIONTESTING   Test completeness criteria       for a condition containing n boolean operands, ...
EXAMPLECase   A       B       B or C   C       Outcome1          1       1      1         0      1      if (A and (B or C)...
LOOP TESTING   Simple Loops:- n is the maximum number of allowable    passes        skip the loop entirely.        only...
EXERCISE   1) Identify what scenarios have to be run to achieve    100% statement coverage and 100% branch coverage    on...
Upcoming SlideShare
Loading in...5
×

Whitebox testing

11,925

Published on

Published in: Education, Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
11,925
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
476
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Whitebox testing"

  1. 1. SOFTWARE QUALITYASSURANCEWHITE BOX Seminar: Oana FEIDI Quality Manager – Continental Automotive
  2. 2. BLACK-BOX VS. WHITE-BOX  Test cases derived from specifications The focus is not the design, nor the implementation  The focus is on the logic of implementation
  3. 3. WHITE BOX (STRUCTURALTESTING) Structural - test case selection is based on an analysis of the internal structure of component  Control flow  Statement testing  Branch/Decision Testing  Branch Condition Testing  Modified Condition Combination Testing  Data flow testing
  4. 4. WHITE BOX Using the white-box testing techniques outlined in this seminar, a software engineer can design test cases that  exercise independent paths within a module or unit;  exercise logical decisions on both their true and false side;  execute loops at their boundaries and within their operational bounds  exercise internal data structures to ensure their validity
  5. 5. STATEMENT TESTING uses a model of the program’s control flow it is designed in order to execute all or selected statements of the test objectTest cases are design to executeeach statement. An entity in a programmingFor each test case specify: language which is typically the smallest indivisible unit of• the input(s) of the component execution.• identification of statement(s) to beexecuted by the test case• the expected outcome of the testcase 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).
  6. 6. EXAMPLE float foo (int a, int b, int c, int d, float e) { float e; if (a == 0) { return 0; } int x = 0; if ((a==b) OR ((c == d) AND bug(a) )) { x=1; } e = 1/x; statement return e; }
  7. 7. BRANCH/DECISION TESTING uses a model of the program’s flow it is designed in order to execute (each) outcome of all or selected decision points in a test object an executable statement For each test specify: which may transfer control • the input(s) of the component to another statement, depending upon the logic • Identification of decision of the decision statement outcome(s) to be executed by the test case • the expected outcome of the test case Test completeness criteria: achievement of the test coverage – 100% of the branches (one true and one false for each part of condition)
  8. 8. EXAMPLEA = true and (B or C) = false A = false and (B or C) = true if A and (B or C) Case A B C Output 1 0 1 1 0 2 1 0 0 0
  9. 9. BRANCH CONDITION COMBINATION 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 For each test case specify:  the input(s) of the component  the expected outcome of the test case which can show which branch is coveredTest completeness criteria: for a condition containing n boolean operands → 2n test cases are required to achieve 100% coverageNote: this coverage rapidly becomes unachievable for more complex conditions.
  10. 10. WHITE BOX - SUMMARY Statement testing  uses a model of the program’s control flow  it is designed in order to execute all or selected statements of the test object Branch/Decision Testing  uses a model of the program’s flow  it is designed in order to execute (each) outcome of all or selected decision points in a test object Branch Condition Combination  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
  11. 11. MODIFIED CONDITION COMBINATIONTESTING usesa model of the program’s flow where each atomic condition is independently tested, in order to show how the decision outcome is affected test case are designed to show that each condition independently affects the decision outcome For each test case specify:  the input(s) of the component  The expected outcome of the test case
  12. 12. MODIFIED CONDITION COMBINATIONTESTING Test completeness criteria  for a condition containing n boolean operands, to achieve 100% coverage are necessary:  minimum: n + 1 test cases  maximum: 2n test cases Example: for 3 boolean operands, to achieve 100% coverage are necessary:  Minimum 4 test cases  Maximum 6 test cases
  13. 13. EXAMPLECase A B B or C C Outcome1 1 1 1 0 1 if (A and (B or C))2 0 03 1 1 1 0 14 0 0 05 1 0 1 1 16 0 0 0
  14. 14. LOOP TESTING Simple Loops:- n is the maximum number of allowable passes  skip the loop entirely.  only one pass thru the loop.  two passes thru the loop.  m passes thru the loop where m< n.  n-1,n,n+1 passes thru the loop Nested loops  start with the innermost loop. Set all other loop to min. values.  conduct simple loop tests for the innermost loop while holding the outer loops at their min. iteration values.  work outward, conducting tests for the next loop, but keeping all the outer loops at their min. iteration count.  continue until all loops have been tested.
  15. 15. EXERCISE 1) Identify what scenarios have to be run to achieve 100% statement coverage and 100% branch coverage on the following code 2) Test the same examples on the following link. Does white-box covers 100% the black-box?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×