White Box Testing
White Box Testing
White Box Testing is a testing technique in which software’s internal structure, design, and
coding are tested to verify input-output flow and improve design, usability, and security. In
white box testing, code is visible to testers, so it is also called Clear box testing, Open box
testing, Transparent box testing, Code-based testing, and Glass box testing.
The testing can be done at system, integration, and unit levels of software development.
One of the basic goals of Whitebox testing is to verify a working flow for an application. It
involves testing a series of predefined inputs against expected or desired outputs so that when
a specific input does not result in the expected output, you have encountered a bug.
To exercise the statements in the above white box testing example, Whitebox test cases
would be
A = 1, B = 1
A = -1, B = -3
Below are a few coverage analysis techniques a box tester can use:
Statement Coverage: This technique requires every possible statement in the code to
be tested at least once during the testing process of software engineering.
Branch Coverage – This technique checks every possible path (if-else and other
conditional loops) of a software application.
Apart from above, there are numerous coverage types such as Condition Coverage,
Multiple Condition Coverage, Path Coverage, Function Coverage etc.
Each technique has its own merits and attempts to test (cover) all parts of software
code. Using Statement and Branch coverage you generally attain 80-90% code
coverage which is sufficient.
Statement Coverage
Decision Coverage
Branch Coverage
Condition Coverage
Multiple Condition Coverage
Finite State Machine Coverage
Path Coverage
Control flow testing
Data flow testing
Unit Testing: It is often the first type of testing done on an application. Unit
Testing is performed on each unit or block of code as it is developed. Unit Testing is
essentially done by the programmer.
As a software developer, you develop a few lines of code, a single function or an
object and test it to make sure it works before continuing Unit Testing helps identify
most bugs, early in the software development lifecycle. Bugs identified in this stage
are cheaper and easy to fix.
Testing for Memory Leaks: Memory leaks are leading causes of slower running
applications.
Conclusion:
White box testing can be quite complex. The complexity involved has a lot to do with
the application being tested. A small application that performs a single simple
operation could be white box tested in few minutes, while larger programming
applications take days, weeks, and even longer to fully test.
White box testing in software testing should be done on a software application as it is
being developed after it is written and again after each modification.