White box testing is a method of Software testing, which tests the code and internal program structure of the Software. White box testing is also known as:
- Clear box testing
- Transparent box testing
- Glass box testing
- Structural testing
Difference between the Black box and White box testing: Black box testing is a method of Software testing, which is used to test the visual functionality of the software in the user point of view without testing the internal code. Whereas White box testing is a method of Software testing, which is used to test the actual code and its implementation structure (Which is inside the box).
Purpose: The purpose of white box testing is to verify the below:
- Reveal the security loopholes
- Reveal the errors in the ‘hidden’ code
- Identify the dead code (Code which is no longer used but not removed from the Software)
- Reveal the bad practices used while programming and promotes in using the best programming practices
- Verify the proper flow of inputs through the code and expected output
White box testing and testing team: The white box testing team need to have the programming skills and also need to know how the software is implemented. The main role of the white box testers is to understand the source code and create/execute the test cases. In white box testing, the testers prepare the input data and provide them as an input to the programs under test to understand the code paths and find the expected outcomes.
White box Testing techniques for creating test cases: The below are the main white box testing techniques (Code coverage criteria techniques), which can be used for creating the test cases:
- Statement coverage – Verifying whether each and every programming statement (i.e. line of code) in the Software code is executed.
- Branch coverage – Verifying whether each and every branch (i.e. Decision coverage like ‘If statements’) in the Software code are executed
- Path coverage – The Thorough technique which verifies whether all the paths of the program code are traveled at-least once.
White box testing and Testing Levels: White box testing technique can be applied to the following testing levels:
- Unit Testing – For testing paths in a unit of code
- Integration Testing – For testing paths connecting the units
- System Testing – For testing the paths connecting the subsystems.
Notes: The following are few important notes on White box testing:
- One of the advantages of White box testing is that it can be stared in the earlier stages of Software when the Software is in programming state and its GUI is not available.
- Another advantage of this testing is, it provides thorough testing covering of all possible paths resulting in the increase of test coverage
- Skilled Resource having in-depth programming knowledge is required for this kind of testing.
- White box testing can be time-consuming, complex and expensive while testing bigger applications.
Please leave your questions/comments/feedback below.
Happy Learning 🙂
Arun Motoori (www.QAFox.com)