White Box Testing! Why we Need of White Box Testing? Know More About White Box Testing

White box testing

In case of functional testing, internal implementation of the code is hidden and no details are being tested. In contrast to this white box, testing deals with testing the implementation details of the code.

A program is a group of various structures and structural testing aims to check all the independent structures of the program. Test case selection is based on the internal of modules. This testing is more precise as compared to black box testing.

White Box Testing! Why we Need of White Box Testing? Know More About White Box Testing

White Box Testing! Why do we need of White Box Testing? Know More About White Box Testing

Using white box testing, the product designer can infer following experiments:-

  1. Guaranteed that every single free way inside module has been practiced at any rate once.
  2. Exercise all logical decision on their true and false side.
  3. Execute all loops at their boundaries and within their operation bounds
  4. Exercise internal data structure to ensure their validity

White Box Testing! Why do we need of White Box Testing? Know More About White Box Testing

Different approaches to white box testing

  1. Control flow based testing
  2. Data flow based testing
  3. Mutation testing

Control flow based testing:-

This technique is based on control graph. The flow graph shows logical condition. We can make flow graph from the source code of a program. A node represents a block of statement. An edge represents a transfer of control. A node that contains condition is referred to as predicate node.

Control flow based testing techniques are:-

  1. Statement coverage testing
  2. Branch coverage testing
  3. Path coverage testing

White Box Testing! Why do we need of White Box Testing? Know More About White Box Testing

Statement coverage testing:-

It requires that each state of the program be executed at least once during testing. As such, it requires that the way executed during testing incorporates all the hub of the diagram. This is otherwise called all hubs criteria.

This testing is not very strong and can leave error undetected. No test case is being defined for ensuring the statement evaluated in the condition is false.

Branch coverage testing:-

It requires that each edge in the control flow graph e traversed at least once during testing. In other words, branch coverage requires that each decision in the program be evaluated to true and false values at least once during testing. This is also known as all edges criteria. Branch coverage implies statement coverage.

The problem arises here is when the decision is evaluated from multiple conditions.

Path coverage testing:-

It requires that all possible path in the controlled flow graph be executed at least once during testing. This is called path criteria and testing based on these criteria is often called path testing. Path criteria imply branch criteria.

Data flow based testing:-

This method select test path of a program according to the location of definition and uses of the variables in the program. One simple data flow based testing strategy is the one that requires every data uses a chain to be covered at least once. This testing strategy is called data uses testing strategy.

Mutation testing:-

The software is first treated y using an initial test suite build up from different white box testing strategy. After all the initial testing is complete mutation testing is taken up. The arbitrary idea behind mutation testing is to make few arbitrary changes to a program at a time.

After all the underlying testing is finished change testing is taken up. The self-assertive thought behind transformation testing is to roll out a couple of self-assertive improvements to a program at any given moment Each time the program is changed it is called the mutated program and changes were done is called mutant.

A mutated program is tested against the full test suite of the program. If there exist at least one test case is the test suite for which a mutant gives an incorrect result then the mutant is said to be dead. If the mutant remains alive even after all the test cases have been exhausted, the test data is enhanced to kill the mutant.

The process of generation and killing of mutant can be automated by predefining a set of primitive changes that can be applied to a program.

These primitive changes can be alternatives such as:-

  1. Changing an arithmetic operator
  2. Changing the value of constant
  3. Changing a data type
Scroll to Top