"Inside the Box: Exploring Black Box and White Box Testing Techniques"
Tags: blackboxtesting, whiteboxtesting, testing, qa
Published: 2024-02-10 06:27:56

In the world of Software testing, there are two eminent testing methodologies which are contrasting yet complimenting to each other and they are called Black box and White box testing. 
Lets take a deep dive into the boxes. 

**Black Box Testing:**
In this testing technique the internal code or structure of the application is not known. By treating the software as an non transparent entity, testers simulate real-world user interactions to validate its behavior against specified customer requirements. 
_Example:_ We validate the login process in an application by entering the username and password.

Now, lets take a look at some of the most important black box techniques, 

## Boundary value Analysis: 
Boundaries are a crucial point where the chances of errors occurring is more. Hence designing test cases for the boundary values of the input increases the probability of finding errors which helps in making our testing efficient. One test case of each boundary value is written and both valid and invalid test cases are tested. 
Test case Example: For an application the Age criteria to sign up is 18 to 60 age. Hence the test cases will be tested as follows,


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/afdj35soayvk8i8hye67.png)

---
**Decision Table Testing**

Decision table testing is a black-box testing technique used to identify different combinations of inputs and their associated actions or outputs in a system. It is particularly useful when dealing with complex business logic or decision-making processes.
The tester needs to create a table, each column in the table represents a different input condition, and each row represents a unique combination of input conditions. Next we need to fill the table with the output for each input combination. 

Test case Example: 

For a banking application when a user tries to login using Email and password, the decision table can be derived as follows, 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v8a49t9gkduz2ze4xeo7.png)

---
**Use case testing:**
It is a type of Black box testing technique in which we identify the test cases that covers entire system on transaction by transaction basis from start to end. 
Test cases are interactions between user(Actor) and the software application(System). 

Test case Example:
For a banking application when a user tries to login using mail id and password, the Use cases will be derived as follows, 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/arwv2gpapp0ko37fude9.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5swaif2r3mlig5ge4d57.png)

---
**White box testing:**
White box testing, also known as clear box testing, structural testing, or glass box testing, is a software testing technique where the internal structure, design, and implementation of the software are examined thoroughly. 

Unlike black box testing, where the tester tests the functionality of the software without any knowledge of its internal workings, in white box testing, the tester has access to the source code and uses this knowledge to design test cases.


**LCSAJ Methodology:**
LCSAJ called as Linear Code Sequence and Jump, is a white box testing technique used in the context of testing programming language or low-level machine code. 

In LCSAJ testing, the goal is to ensure that all the different sequences of assembly instructions in a program are executed and tested thoroughly. This technique helps in identifying potential bugs or errors that might arise due to unexpected interactions between instructions or data dependencies.

To perform LCSAJ testing, testers typically create test cases that cover all possible contiguous sequences of assembly instructions in the program. This ensures comprehensive coverage of the code and helps in uncovering hidden defects.

LCSAJ testing is particularly important in critical software systems, such as those used in safety-critical applications or in embedded systems, where even small errors can have serious consequences.

Example: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j2rx4r2owzeo8n88kyvl.png)