Friday, July 30, 2010


White-Box Testing
  • White-box test design allows one to peek inside the "box“
  • Synonyms for White-box are Structural, Glass-box and Clear-box
  • White-box Testing assumes that the path of logic in a unit or program is known
  • White-box Testing consists of testing paths, branch by branch, to produce predictable results
  • Focuses specifically on using internal knowledge of the software to guide the selection of test data
White-Box Testing Techniques
Statement Coverage
execute all statements at least once
Decision Coverage
execute each decision direction at least once
Condition Coverage
execute each decision with all possible outcomes at least once
Decision/Condition Coverage
execute all possible combinations of condition outcomes in each decision
Multiple Condition Coverage
invoke each point of entry at least once

 Choose the combinations of techniques appropriate for the application

Statement Coverage
Necessary but not sufficient, doesn’t address all outcomes of decisions
For example
…….
Begin()
If (function1())
 OpenFile1()
Else
 Shutdown();
………
Here if the first IF statement is true then Shutdown will never occur

Decision Coverage
Validates the Branch Statements in software
Overcomes the drawbacks of statement coverage
Each decision is tested for a True & False value
Each branch direction must be traversed at least once
Branches like if…else, while, for do...while are to be evaluated for both true and false
Test cases will be arrived with the help of a Decision table

Decision Table
Table which helps to derive the test cases
Steps
Identify the variables which are responsible for decision
Identify the total number of decisions (Give numbers to them like IF1, IF2… While1, While2 etc)
Put the variables as rows and decisions as verticals
Start to map the values for each variables corresponding to each decisions
An Example
Procedure liability (age, sex, married, premium);
begin
 premium=500;
  If ((age< IF-1
25) and (sex=male) and (not married)) 
  then
  premium=Premium+1500;
  else
 IF-2
  (if (married or (sex=female))       
  then
  premium=premium-200;
  If( (age>45) and (age< IF-3
65))       
  then
  premium= premium-100;
end;
Here variables are age, sex and married
Decisions are IF1; IF2 ; IF3 


No comments:

Post a Comment