https://unstop.com/blog/structural-testing
Structural testing is one of many types of software testing, although structural testing is directly testing the internal structure of the code which means it is important that the individual performing structural tests is very familiar with the language used for the code. This type of testing uses white box testing techniques and it is more concerned with how a system is running rather than its functionality which is the more common reason for testing. There are four different types of structural testing which are mutation, data flow, control flow and slice-based testing. Mutation testing is a type of structural testing which relies on changing small parts of the code’s structure in order to test for errors, there are different types of mutation testing which are based on changing different parts of the code’s structure in order to find possible errors. Data flow testing is used to analyze how data flows through a program and control flow is used to show the order in which statements will be executed. Slice-based testing takes a portion of statements which may affect the final value of a variable and uses those slices to test the change. There are three different techniques used while doing structural testing which are called statement, branch and path coverage. Some common open source tools for structural testing include Cucumber, JBehave, Cfix and JUnit.
I found this article interesting as it not only gives an in-depth explanation on structural testing but it also provides you with both techniques and tools which can be used to perform such testing. The advantages and disadvantages section particularly piqued my interest as one of the first advantages listed is that early defects can be easily identified which I would infer is due to the direct testing of the code structure versus testing its sole functionality. The cost of this type of testing however is a huge disadvantage as the time and money it takes to go through all of the testing necessary is much more than other types of testing. This article did teach me a lot about structural testing as most of the testing I have personally done has been testing what inputs get a certain output and testing direct implementation of a body of code versus actually testing the structure and being able to see how a piece of data flows through code which is a very important aspect of testing even if this testing is very expensive.
From the blog CS@Worcester – Dylan Brown Computer Science by dylanbrowncs and used with permission of the author. All other rights reserved by the author.