Javatpoint Logo
Javatpoint Logo

White Box Testing

The box testing approach of software testing consists of black box testing and white box testing. We are discussing here white box testing which also known as glass box is testing, structural testing, clear box testing, open box testing and transparent box testing. It tests internal coding and infrastructure of a software focus on checking of predefined inputs against expected and desired outputs. It is based on inner workings of an application and revolves around internal structure testing. In this type of testing programming skills are required to design test cases. The primary goal of white box testing is to focus on the flow of inputs and outputs through the software and strengthening the security of the software.

The term 'white box' is used because of the internal perspective of the system. The clear box or white box or transparent box name denote the ability to see through the software's outer shell into its inner workings.

Test cases for white box testing are derived from the design phase of the software development lifecycle. Data flow testing, control flow testing, path testing, branch testing, statement and decision coverage all these techniques used by white box testing as a guideline to create an error-free software.

White Box Testing

White box testing follows some working steps to make testing manageable and easy to understand what the next task to do. There are some basic steps to perform white box testing.

Generic steps of white box testing

  • Design all test scenarios, test cases and prioritize them according to high priority number.
  • This step involves the study of code at runtime to examine the resource utilization, not accessed areas of the code, time taken by various methods and operations and so on.
  • In this step testing of internal subroutines takes place. Internal subroutines such as nonpublic methods, interfaces are able to handle all types of data appropriately or not.
  • This step focuses on testing of control statements like loops and conditional statements to check the efficiency and accuracy for different data inputs.
  • In the last step white box testing includes security testing to check all possible security loopholes by looking at how the code handles security.

Reasons for white box testing

  • It identifies internal security holes.
  • To check the way of input inside the code.
  • Check the functionality of conditional loops.
  • To test function, object, and statement at an individual level.

Advantages of White box testing

  • White box testing optimizes code so hidden errors can be identified.
  • Test cases of white box testing can be easily automated.
  • This testing is more thorough than other testing approaches as it covers all code paths.
  • It can be started in the SDLC phase even without GUI.

Disadvantages of White box testing

  • White box testing is too much time consuming when it comes to large-scale programming applications.
  • White box testing is much expensive and complex.
  • It can lead to production error because it is not detailed by the developers.
  • White box testing needs professional programmers who have a detailed knowledge and understanding of programming language and implementation.

Next TopicData Flow Testing

Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials

B.Tech / MCA