White Box Testing & Black Box Testing in Software Engineering

Testing is the process of executing a program with the aim of finding errors. To make our software perform well it should be error-free. If testing is done successfully it will remove all the errors from the software. We have a specialized team of engineers specifically to perform the software testing. We provide the customer with the information about the quality of the product or service under test. Our Test Techniques includes the process of executing a program or application with the intent of finding the bugs and errors and verify that the final Product is fit to use and can be installed and run in its intended environment and perform its function within an acceptable time. We follow various fitting software algorithms, executing test protocols, test plans, test strategies and testing methodologies. We create test protocols and run these test protocols on target systems. We perform Functional, UI, Compatibility, interoperability, usability, integration, system and acceptance testing.

White Box Testing in Software Engineering
White box testing techniques analyze the internal used data structures, internal design, code structure and the working of the software rather than just the functionality as in black box testing. It is also called glass box testing or clear box testing or structural testing.

Working process of white box testing:
Input: Requirements, Functional specifications, design documents, source code.
Processing: Performing risk analysis for guiding through the entire process.
Proper test planning: Designing test cases so as to cover entire code. Execute rinse-repeat until error-free software is reached. Also, the results are communicated.
Output: Preparing final report of the entire testing process.

Testing techniques:
Statement coverage: In this technique, the aim is to traverse all statement at least once. Hence, each line of code is tested. In case of a flowchart, every node must be traversed at least once. Since all lines of code are covered, helps in pointing out faulty code.

Branch Coverage: In this technique, test cases are designed so that each branch from all decision points are traversed at least once. In a flowchart, all edges must be traversed at least once.

Basis Path Testing: In this technique, control flow graphs are made from code or flowchart and then Cyclomatic complexity is calculated which defines the number of independent paths so that the minimal number of test cases can be designed for each independent path.

Loop Testing: Loops are widely used and these are fundamental to many algorithms hence, their testing is very important. Errors often occur at the beginnings and ends of loops.

Advantages:
White box testing is very thorough as the entire code and structures are tested.
It results in the optimization of code removing error and helps in removing extra lines of code.
It can start at an earlier stage as it doesn’t require any interface as in case of black box testing.
Easy to automate.

Black Box Testing in Software Engineering
Black box testing is a type of software testing in which the functionality of the software is not known. The testing is done without the internal knowledge of the products.

Working process of black box testing:
Syntax Driven Testing – This type of testing is applied to systems that can be syntactically represented by some language. For example- compilers, language that can be represented by context free grammar. In this, the test cases are generated so that each grammar rule is used at least once.

Equivalence partitioning – It is often seen that many type of inputs work similarly so instead of giving all of them separately we can group them together and test only one input of each group. The idea is to partition the input domain of the system into a number of equivalence classes such that each member of class works in a similar way, i.e., if a test case in one class results in some error, other members of class would also result into same error.

Boundary value analysis – Boundaries are very good places for errors to occur. Hence if test cases are designed for boundary values of input domain then the efficiency of testing improves and probability of finding errors also increase. For example – If valid range is 10 to 100 then test for 10,100 also apart from valid and invalid inputs.

Cause effect Graphing – This technique establishes relationship between logical input called causes with corresponding actions called effect. The causes and effects are represented using Boolean graphs. The following steps are followed:
Identify inputs (causes) and outputs (effect).
Develop cause effect graph.
Transform the graph into decision table.
Convert decision table rules to test cases.

Requirement based testing – It includes validating the requirements given in SRS of software system.

Compatibility testing – The test case result not only depend on product but also infrastructure for delivering functionality. When the infrastructure parameters are changed it is still expected to work properly. Some parameters that generally affect compatibility of software are:
Processor (Pentium 3,Pentium 4) and number of processors.
Architecture and characteristic of machine (32 bit or 64 bit).
Back-end components such as database servers.
Operating System (Windows, Linux, etc).

What-is-black-box-testing-&-white-box-testing-and-it's-advantages-in-software-engineering1