White box testing strategy deals with the internal logic and structure of the code. White box testing is also called as glass box testing, structural testing, open box testing or clear box testing. The tests written based on the white box testing strategy incorporate coverage of the code written, branches, paths, statements and internal logic of the code etc.
In order to implement white box testing, the tester has to deal with the code and hence is needed to possess knowledge of coding and logic i.e. internal working of the code. White box test also needs the tester to look into the code and find out which unit/statement/chunk of the code is malfunctioning.
Advantages of White box testing are:
* As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of input/data can help in testing the application effectively.
* The other advantage of white box testing is that it helps in optimizing the code
* It helps in removing the extra lines of code, which can bring in hidden defects.
Disadvantages of white box testing are:
* As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out this type of testing, which increases the cost.
* And it is nearly impossible to look into every bit of code to find out hidden errors, which may create problems, resulting in failure of the application.
Following techniques can be applied in white box testing:-
* Statement Coverage Testing:- The percentage of executable statements that have been exercised by a est suite.100% decision coverage doesnot gurantee 100% decision coverage.
* Decision Coverage Testing:- The percentage of decision outcomes that have been exercised by a test suite. 100% decision coverage implies both 100% branch coverage and 100% statement coverage
* Condition Coverage Testing:- The percentage of condition outcomes that have been exercised by a test suite. 100% condition coverage requires each single condition in every decision statement to be tested as True and False.
* Branch Coverage Testing:- The percentage of branches that have been exercised by a test suite. 100% branch coverage implies both 100% decision coverage and 100% statement coverage.
* Code coverage Testing:- An analysis method that determines which parts of the software have been executed (covered) by the test suite and which parts have not been executed, e.g. statement coverage, decision coverage or condition coverage.