---
title: "White box and black box testing"
subject: "Instrumentation II"
chapter: 9
key: "semester_5/instrumentation_ii:white-black-box"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/white-black-box
site: BCT Engineering
---

# White box and black box testing

Instrumentation II · Chapter 9: Software For Instrumentation And Control Applications

- Asked in: 2078 Bhadra, 3 marks
- Video: [Black Box Testing Full Concept Explain in Software Engineering in Hindi | SE Tutorials](https://www.youtube.com/watch?v=49i26aesGaU) — Last moment tuitions
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/instrumentation_ii/white-black-box
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-9

## Question

Write about White box testing and Black box testing.

## Short answer

White-box testing uses internal code knowledge to test statements, branches, and paths; performed by developers. Black-box testing checks against specification through inputs/outputs, using equivalence partitioning and boundary analysis, without looking at code. White-box finds logic errors, black-box finds missing functions and interface issues.

## Answer

#### White-box testing
White-box (structural, glass-box) testing tests the **internal structure and logic of the code**. The tester knows the source code and designs test cases to exercise statements, branches, paths and loops.
- Techniques: statement coverage, branch/decision coverage, condition coverage, path coverage, loop testing, data-flow testing.
- Done mostly by developers at the unit level. Finds logic errors, unreachable code and hidden paths.
- Needs programming knowledge; costly for large programs.

#### Black-box testing
Black-box (functional, behavioural) testing tests the software **only through its inputs and outputs against the specification**, without knowledge of the internal code.
- Techniques: equivalence partitioning, boundary value analysis, decision tables, state transition and error guessing.
- Done by testers at system and acceptance levels. Finds missing functions, interface and requirement errors.
- It cannot check internal code paths, so some bugs can remain.

| Aspect | White box | Black box |
|---|---|---|
| Knowledge of code | Required | Not required |
| Based on | Code structure | Specification |
| Done by | Developer | Tester/user |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. White-box testing is based on?
   A. Code structure and internal logic
   B. Specification only
   C. User opinions
   D. Hardware specs
   Answer: A. Tester knows source code. (Key point: White box)

2. Black-box testing needs?
   A. Source code
   B. No knowledge of internal code
   C. Path coverage
   D. Developer only
   Answer: B. Tests inputs and outputs against specification. (Key point: Black box)

3. Which is a black-box technique?
   A. Branch coverage
   B. Path coverage
   C. Equivalence partitioning
   D. Loop testing
   Answer: C. Others are white-box. (Key point: Techniques)

## Related in other subjects

- [Black-box versus white-box testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Ablack-box-vs-white-box) — Software Engineering, chapter 8
- [Black-box testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Ablack-box-testing) — Software Engineering, chapter 8
