Structural Testing

What is structural testing?

Structural testing, also known as glass box testing or white box testing, is an approach where the tests are derived from the knowledge of the software’s structure or an internal implementation.

Structural testing may be performed at all test levels. Structural techniques are best used after specification-based procedures to help measure the thoroughness of testing by assessing the coverage of a type of structure.

Coverage is the extent of a structure exercised by a test suite, expressed as a percentage of the items being covered. If coverage is not 100%, then more tests may be designed to test those missed items to increase coverage.

At all test levels, but especially in component testing and component integration testing, tools can be used to measure the code coverage of elements, such as statements or decisions. Structural testing may be based on the system’s architecture, such as a calling hierarchy.
Structural testing approaches can also be applied at system, system integration, or acceptance testing levels (e.g., to business models or menu structures).

Benefits of structural testing


Types of structural testing

Control flow testing is structural testing that uses the program’s control flow as a model. The entire code, design, and structure of the software have to be known for this type of testing. The developers often use this type of testing to test their own code and implementation. This method is used to test the code’s logic so that the required result can be obtained.

It uses the control flow graph to explore the unreasonable things that can happen to data.
Data flow anomalies are detected based on the associations between values and variables.

It is helpful for software debugging, maintenance, program understanding, and quantification of functional cohesion. It divides the program into different slices and tests that slice which can majorly affect the entire software.

Mutation Testing is a type of software testing performed to design new software tests and evaluate the quality of already existing software tests. Mutation testing is related to the modification of a program in small ways. It focuses on helping the tester develop effective tests or locate weaknesses in the test data used for the program.