What is Structural Testing?
Structure Testing is nothing but testing of the structure of the software system or component.
It checks the implementation of the program or code. The objective of Structural Testing is not to check different input or output conditions but to check different data and programming structure used in the program. It can also be called Glass Box Testing, White Box Testing, Clear Box Testing, Open Box Testing, Logic Driven Testing or Path Driven Testing.
Why to do Structural Testing?
Structural Testing is done
- To understand what is missing in our test suite
- To complement functional testing
- It helps to identify obvious inadequacies
Categories of Structural Testing
The whole structural Testing is categorized into four division
- Statement Coverage: It is the weakest form of testing, as it requires that every statement in the code has to be executed at least once.
- Branch Coverage: In this each branch condition for the program is tested for its true or false values.
- Path Coverage: For path coverage, the path of the program is executed at least once, it test individual path for the program
- Condition Coverage: In this type of testing, it checks all possible combinations of conditions. For conditional branches, we execute the TRUE branch at least once and the FALSE branch, at least, one. Unlike branch coverage, it tests for both conditional as well as non- conditional branches.
How to perform Structural Testing
Structural Testing is based on two factors Control Flow Testing Theory and Building Control Flow Graphs.
- The algorithm for all control flow testing consists of a strategy of converting the code into a control graph.
- Control graph gives the visual representation of the structure of code
- After this, the code to be tested is identified, and test cases are created for the test that is specific to path or condition
- Test cases generated are based on the structure of the program
For performing Structural Testing, there are mainly two approaches-
- Control oriented: It tells how much control aspect of the code has been explored
- Data oriented: It tells how much relationship between the data elements has been explored
Structural V/s Functional Testing
- Structural Testing is about testing the implementation of the program or code
- Structural testing is basically a white box testing method
- Structural Testing is categorized into
- Statement Coverage
- Branch Coverage
- Path Coverage
- Condition Coverage
- Structural Testing is based on two factors Control Flow Testing Theory and Building Control Flow Graphs.