What is White Box testing? Techniques of White-box testing

Definition of White-box testing
White box testing is also known as structural testing. In this kind of testing the internal structure of the application is exposed to the tester. While designing the test cases internal coding and logic of the software is considered as well as the programming skills of the developer are tested. White box testing is also referred as Glass box testing, clear box testing or code-based testing. Unlike black box testing, here we not just check the functionality part of the application but we thoroughly evaluate the coding and implementation part.

While box testing can be applied in any of the testing level i.e. unit testing, integration testing and system testing.

Example of White Box Testing:
A tester studies the programming logic while testing any of the web pages and depending upon that he designs the test cases. Testers identify the valid and invalid inputs and expected outcomes by studying the code of the webpage to be tested.

White box testing techniques

1) Control flow testing
In control flow testing a graphical representation of all the routes can be traversed in the modules of the application during its execution is prepared. With the help of control flow graph the cyclomatic complexity of the graph can be calculated and the number of the test cases for testing the module can be identified. Often this is done by developers themselves to test their work.

2) Data flow testing
Data flow testing is basically used to check whether the declaration and initialization of the variables in the modules have been used properly or not. Here we try to ascertain if the data i.e. variables have been used properly or not. Data-flow graph is used to depict dependency of variables on number of operations over the full cycle of the module.

3) Branch testing
Branch coverage testing method is used to check whether each of the branches from logic of the modules is executed correctly or not. Hence each branch is considered while testing the whole module. It is used to ensure that none of the decision points are giving false outcome. Here redundant branches can also be identified and eliminated to optimize the code.

4) Statement coverage
In statement coverage each line in the module of the application is tested. It is used to check whether each of the statements in the module is covered or not.
It checks if any of the code is not executed because of the blockage or any other reason. Here too redundant statements can be identified and eliminated.

5) Decision coverage
Decision coverage is same as branch coverage. In decision coverage testing method is used to check whether each of the branches from logic of the modules is executed correctly or not. Hence each branch is considered while testing the whole module. It is used to ensure that none of the decision points are giving a false outcome. Conditions that invoke a particular branch is also tested against the requirements.

6) Path testing
Path Testing is s structural testing method which is based on structural testing. It is used in designing test cases intended to examine all possible paths. It ensures that all the statements and all the branches are covered in the test cases.

7) Prime path testing
A prime path in path testing is defined as a path that cannot be extended without losing simplicity. This cuts down the number of test cases in path testing.

Next up we will see the advantages and disadvantages of white box testing.

Read More:
Benefits and Drawbacks of Black Box testing
Functional and Non-functional testing techniques
Pros of unit testing in Software development

Copyright © ianswer4u.com

0 Reactions:

Post a Comment