Structural Testing | White Box Testing | Glass Box Testing
Structural testing is the type of testing carried out to test the structure of code. It is also known as White Box testing or Glass Box testing. This type of testing requires knowledge of the code, usually done by the developers.
Features of Structural testing :
- Structure testing is applicable to all test levels
- Measures thoroughness through assessment of coverage
- Coverage measurement is usually done by a tool
- This Type of testing approaches can also be applied at the system level based on architecture and hierarchy.
Structural Testing Techniques:
1) Statement Coverage :
Statement coverage technique is aimed at exercising all programming statements with minimal tests. Please refer Statement Coverage for in-depth details.
2) Branch Coverage:
Branch coverage technique is running a series of tests to ensure that all branches are tested at least once.Please refer Branch Coverage for in-depth details.
3) Path Coverage :
Path Coverage technique corresponds to testing all possible paths which means that each statement and branch are covered. Please refer Path Coverage for in-depth details.
Advantages of Structural Testing:
- Provides a more detailed testing of the software.
- Helps finding out bugs at an early stage.
- Helps in removing dead code.
- It does not require a lot of manual work.
- Not time consuming as it is mostly automated.
Disadvantages of Structural Testing:
- Requires training in the tool used for testing
- Requires knowledge of the code.
- There is also a slight chance that some lines or statements or branches could be missed accidentally.
Structural Testing Tools:
JBehave: BDD tool intended to make the BDD process easy and smooth.
Cucumber: BDD testing tool used to verify whether an application has met its requirement
JUnit: Used to create a good foundation for developer based testing.
Cfix: A robust unit testing framework used to make a developer based test suite easy.