White Box Testing

White box testing is also referred to as structure based testing, structural testing and glass box testing. In this technique, the knowledge of code or internal architecture of the system is required to carry out the testing.


White box testing is the type of testing which testing is carried out based on the knowledge of the internal architecture of the application. In white-box testing, the tester analyzes the quality of source code on different parameters like code optimization, code coverage, code reusability etc.



It is applicable for lower levels of testing types - unit testing and integration testing where we have to deal with individual modules of the application and their interfacing.


White box testing techniques

The different types of white box testing techniques are-

  • Statement testing - In statement testing, the test scripts are designed to execute the code and the coverage is measured by the line of code or statements executed by test scripts.
  • Decision testing/branch testing - In decision testing we measure of the percentage of decision points(e.g. if-else conditions) executed out of the total decision points in the application.
  • Condition testing - Condition testing involves testing the individual conditions for both the outcomes -TRUE and FALSE. So, getting 100% condition coverage requires exercising each condition for both TRUE and FALSE results(for n conditions, we will have 2n test scripts).
  • Multiple condition testing - Testing the different combinations of condition outcomes. Hence for 100% coverage we will have 2^n test scripts. This is very exhaustive and very difficult to achieve 100% coverage.
  • Condition determination testing - It is an optimized way of multiple condition testing in which the combinations which doesn't affect the outcomes are discarded.
  • Path testing - Path testing involves testing carried out by covering the independent paths in the system where paths are executable statements from entry to exit points.