---
title: "What are white box testing and black box testing? Explain with examples."  
description: "What are white box testing and black box testing? Explain with examples."  
author: "Revati S Misra"  
published: 2023-04-05  
updated: 2023-04-06  
canonical: https://www.mindstick.com/forum/157698/what-are-white-box-testing-and-black-box-testing-explain-with-examples  
category: "software engineering"  
tags: ["software development", "software"]  
reading_time: 2 minutes  

---

# What are white box testing and black box testing? Explain with examples.

What are [white box testing](https://www.mindstick.com/forum/471/why-is-white-box-testing-called-as-glass-box-testing) and [black box testing](https://www.mindstick.com/articles/103/black-box-testing)? [Explain](https://www.mindstick.com/forum/157854/what-is-system-debugging-explain-some-system-debugging-tools-used-in-modern-computer-systems) with examples.

## Replies

### Reply by Krishnapriya Rajeev

**[Black box](https://www.mindstick.com/forum/470/what-are-the-advantages-disadvantages-of-black-box-testing) [testing](https://www.mindstick.com/articles/1849/role-of-testing-in-software-development)** or closed testing is a method of software testing that tests the *external design* of the software in addition to its overall functionality and structure. The internal design or the implementation of the software is unknown to the tester.

Example: Testing the functionality of a search engine by giving it certain inputs and checking the corresponding results.

On the other hand, **white box** or glass box testing is a method of software testing that tests the *internal design* of the software, i.e. the implementation of the software is being tested and is known to the tester.

Example: Testing all the loops and conditions in a piece of code by giving multiple inputs (test cases) and observing the outputs, while at the same time checking for errors.

The key differences between these two methods are:

| **Black Box Testing** | **White Box Testing** |
| --- | --- |
| Details regarding the implementation of the program is hidden. | Details regarding the implementation of the program is available to the tester. |
| It tests the functional capabilities of the software. | It tests the structural features of the software. |
| These tests can be done based on the software requirements specification (SRS) document. | These tests are done after creating a detailed software design document |
| Higher-level software testing is being done. | Low-levelareare software testing is being done. |
| Programming knowledge is not required. | Knowledge of programming is mandatory. |
| It is not time-consuming. | It is time-consuming |
| It is a form of behavioral testing. | It is a form of logic testing. |
| It is not preferred for testing algorithms. | It is suitable for testing algorithms. |


---

Original Source: https://www.mindstick.com/forum/157698/what-are-white-box-testing-and-black-box-testing-explain-with-examples

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
