EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials Software Testing Tutorial Structural Testing
Secondary Sidebar
Software Testing Tutorial
  • Types of Testing
    • Adhoc Testing
    • Types of System Testing
    • Manual Testing Types
    • Unit Testing Types
    • Unit Testing Benefits
    • Agile Testing
    • What is Agile Testing
    • Acceptance Testing
    • Stress Testing Types
    • Alpha and Beta Testing
    • Application Testing
    • Automation Testing
    • Automation Testing Advantages
    • Benchmark Testing
    • Black Box Testing
    • Domain Testing
    • Dynamic Testing
    • Ecommerce Testing
    • Fuzz Testing
    • Gray Box Testing
    • GUI Testing
    • Installation Testing
    • Interface Testing
    • Interoperability Testing
    • Mainframe Testing
    • Manual Testing
    • Mutation Testing
    • Monkey Testing
    • Negative Testing
    • Penetration Testing
    • Penetration testing phases
    • Penetration testing framework
    • Protocol Testing
    • Recovery Testing
    • Regression Testing
    • Mobile Penetration Testing
    • Accessibility Testing
    • Sanity Testing
    • Scalability Testing
    • Security Testing
    • Spike Testing
    • Stability Testing
    • State Transition Testing
    • Static Testing
    • Gatling Load Testing
    • System Integration Testing
    • Structural Testing
    • Locust Load Testing
    • System Testing
    • Control Flow Testing
    • Unit Testing
    • Cypress testing
    • Volume Testing
    • Web Testing Application
    • What is Exploratory Testing
    • What is Stress Testing
    • What is Usability Testing
    • White Box Testing
    • Types of White Box Testing
    • Compatibility Testing?
    • Use Case Testing
    • Beta Testing
    • Integration Testing
    • Non Functional Testing
    • Non Functional Testing Types
    • What is Functional Testing
    • Functional testing types
    • Cookie Testing
    • Alpha Testing
    • Boundary Value Testing
    • Equivalence Class Testing
    • Glass Box Testing
    • SOA Testing
    • Smoke Testing
    • Visual Testing
    • Visual Paradigm
    • Model-Based Testing
  • Basics
    • What is Software Testing
    • Careers in Software Testing
    • Defect Life Cycle in Software Testing
    • Bug Life Cycle
    • Levels of Software Testing
    • Software Testing Life Cycle
    • Software Tester Work
    • Software Testing Principles
    • Software Testing Services
    • Testing Methodologies
    • Test Approaches
    • Types of Software Testing
    • What is a Bug in Software Testing
    • Benefits of Automation Testing
    • What is Automation Testing?
    • Types of Automation
    • Typical Journey of a Software Tester
    • Automation Testing Process
    • Mobile Automation Testing
    • Automation Testing Life Cycle
    • Software Quality Assurance
    • Software Quality Assurance
    • What is Test Environment?
    • Verification and Validation Testing
  • Testing techniques
    • Software Testing Methodologies
    • Black Box Testing Techniques
    • Static Testing Techniques
    • Test Case Design Techniques
    • What is Static Analysis
  • Testing tools
    • Manual Testing Tools
    • Visual Testing Tools
    • Automation Testing Tools
    • Functional Testing Tools
    • GUI Testing Tools
    • Penetration Testing Tools
    • Performance Testing Tools
    • SOA Testing Tools
    • Accessibility Testing Tools
    • What is QTP
    • Regression Testing Tools
    • Security Testing Tools
    • Test Management Tools
    • Defect Management Tools
    • Code Coverage Tools
    • Test Coverage Tools
    • Defect Tracking Tools
    • Continuous Integration Tools
    • Install Bugzilla
    • Test data generation tool
    • Unit Testing Tools
    • Web Testing Tools
    • Stress Testing Tools
    • Performance Monitoring Tools
    • Mobile Testing Tools
    • Responsive Testing Tool
    • Cross Browser Testing Tools
    • Risk Based Testing
    • Database Testing Tools
    • WinRunner
    • What is Squish?
    • CubicTest
    • What is WinRM?
    • Bugzilla Tool
    • Code review tools
    • Penetration Testing Open Source Tools
  • Advance
    • Cyclomatic Complexity
    • Decision Table Testing
    • Decision Tree Algorithm
    • What is Continuous Integration
    • Mantis Bug Tracker
    • Equivalence Partitioning
    • Gantt Chart Software
    • Acceptance Testing Types
    • Load testing tools
    • Install TestNG
    • Install Unity
    • Defect Management Process
    • Test Plan Template
    • Testing Interview Questions
    • Testing of Mobile application
    • What is Test Automation Frameworks
    • Test Automation Framework
    • Application of Automation
    • Test Automation Process
    • Automation Testing Roles and Responsibilities
    • What is Instruction Cycle?
    • What is Cucumber?
    • 15 Best Popular Bug Reporting Tools
    • What is Automated Testing?
    • Software Maintenance Types
    • Types of Penetration Testing
    • Software Reliability
    • Best Gantt Chart Software
    • Code Coverage
    • Branch Coverage
    • Decision Coverage
    • Statement Coverage
    • What is Test Case
    • Types of Test Case
    • What is Test Scenario
    • Formal Review
    • Alpha Beta Pruning
    • What is Cyclomatic Complexity?
    • Test Coverage
    • How to Write Test Case
    • Testing Documentation
    • Performance Testing Life Cycle
    • Test Harness
    • Test Strategy
    • Software Incident Management
    • What is Debugging
    • What is Defect?
    • Listeners in TestNG
  • Inteview Questions
    • Automation Testing Interview Questions
    • Manual Testing Interview Questions
    • ISTQB Interview Questions
    • Cucumber Interview Questions
    • Software Testing Interview Questions
    • Penetration Testing Interview Questions

Structural Testing

By Priya PedamkarPriya Pedamkar

Structural Testing

Introduction to Structural Testing

Structural Testing is a type of testing in which the complete code of the application is tested. This is different from the other type testing which black box where the main concentration is on the type of output generated rather than the way the output generated.

when the software is developed it is expected to be tested from all the aspects so that the production environment is defects free. There are different testing strategies and structural testing is one of them. In software testing basically the outputs are generally matched with the expected output.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

There are two main methodologies of two testing’s and they are often referred to as white-box testing and black-box testing. Structural testing is generally a white box testing where the main consideration is on the structure of the code. In the black box testing, the output result is compared with expected result but how the output or what is the code that generated the output is not tested. This testing is taken care of by the structural testing.

Structural Testing with Diagram

Structural Testing1

Since here the code is being tested it is expected that the associate who is testing has a good understanding of the programing language in which the code has been written. The structural testing is concentrated on how the system is doing rather than the functionality of the system. Thus this testing is just the opposite of behavioral testing. Most of the time structural testing is also referred to as white Box Testing and also as open, transparent or glass testing basing on the code.

We can see the above diagram. With white box testing, we are passing the input and we are monitoring that who the input is traversing and being acted upon to generate the output. This is not the case with the black box testing as it is the mainly considering that the output is as per expectation of the functional requirement. In a way, all the standards of the code and associated risks get captured in the structural testing only.

Now let us see a few of the techniques of structural testing. Below are a few structural techniques.

  • Statement Coverage
  • Path Coverage
  • Branch Coverage
  • Condition

1. Statement Coverage

The main aim of this technique of structural testing is to make sure all the statements of the code gets tested. The adequacy criterion should be 1 which makes sure that we have 100% coverage. This good in testing each statement or part but this technique not good in testing the control flow. This can be illustrated from below diagram

Statement Coverage

In the above diagram N1, N2, N3, N4, N5 will be basic blocks to be tested and E1 to E5 represents the edges. This N1-N5 is sequences of the statements and E1- E5 are edges that indicates the control flow. Now in statement coverage, the nodes will be covered by below two steps

E1 -> E2 -> E5 E1 -> E3

you can see that the E4 is missed which is control flow. N3 is having two exits E5 and E4 but since N4 block or statement is already covered by E3, E4 will not be covered and hence one E5 will be taken from N3. This is one flaw in statement coverage.

2. Path Coverage

These techniques supposedly used to tests different paths from entry to exit points without a miss and this can be different combinations of decisions taken in the sequence. Some time path can be too many to be tested such as in case of larger loops. This can be avoided by adopting cyclomatic complexity that helps in identifying the redundant test cases and eliminate them. Thus we can test linearly the independent paths using cyclomatic complexity in path coverage.

3. Branch Coverage

Branch coverage aims to test all the edges or branches of the code. Thus the E4 that was getting missed as part of statement coverage will be covered here. Thus branch covaerhe provide better solution to coverage testing by solving the shortcoming of statement covergae. Let us look at below diagram to get better understanding of branch coverage.

Branch Coverage

here full 100% branch coverage is provided by following E1 -> E2

E3

but we can see that E1 is a TRUE branch and we can obtain TRUE conditions by multiple conditions. But branch test main aim to test each branch once. This E1 which an evaluate True on multiple conditions such as (A>2 [True] and B>8 [False]. This evaluates E1 as True) or (A<2 [False] and B<8 [True] which again evaluates E1 as True). This short come is tested in conditional coverage.

4. Conditional Coverage

The main aim of this techniques are to test all the possible combinations of conditions along with that of the one, we missed in branch coverage. Thus even though this looks like an extension of branch coverage, it provides better coverage. But there is one problem associated with conditional coverage and that is getting exponentially increased conditions due to numerous combinations that need to be avoided.

Advantages and Disadvantages of Structural Testing

Below are the advantages and disadvantages:

Advantages

Below are the advantages:

  • It provides thorough testing of the code and finally the software
  • All the early defects can easily be identified
  • It eliminates the dead code or statements
  • The steps of structural can be automated if you have time
  • Translational errors while typing, unwanted Risks with the data and other technical standards can easily be validated with this testing

Disadvantages

Below are the disadvantages:

  • There are few shortcomings in each technique as discussed in each coverage even though there are alternates
  • Heavy dependency on the skill set of the tester as thee code component is tested
  • Since this is more detailed testing, it is quite

Conclusion

Thus in this article we have seen the structural testing in detail like what are the different techniques and how are they different from each other. We also got answers for how structural testing is different from behavioral testing etc. This if the project is hugely critical and the user does not want to take any chance then they opt for structural testing as it more robust testing.

Recommended Articles

This is a guide to Structural Testing. Here we discuss an introduction to Structural Testing along with techniques and block diagrams. You can also go through our other related articles to learn more –

  1. Automation Testing Life Cycle
  2. Dynamic Testing
  3. Manual Testing
  4. Static Testing
Popular Course in this category
Software Testing Training (11 Courses, 2 Projects)
  11 Online Courses |  2 Hands-on Projects |  65+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Penetration Testing Training Program (2 Courses)4.9
TestNG Training (4 Courses, 2 Project)4.8
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more