# Black-Box Testing

> Testing what a program does. You do not look at its code.

**Field:** Software Development  
**Category:** Testing & Quality  
**Also known as:** Black Box Testing, Black-Box Test, Behavioral Testing

## Think of it like

Think of it like testing a snack machine. You put in a coin, press a button and check what drops out.

## Definition

Black-box testing checks what a program does without looking at its code. The tester gives it inputs and checks the outputs. They compare the results with what the spec says should happen. They do not need to know how it works inside. Most acceptance tests and manual tests work this way.

## Example

Lucy tests a login form. She tries a right password, a wrong one and an empty one, and checks each answer.

## Why it matters

It tests the app the way users meet it, and it does not break when the code inside changes.

## Common mistake

Thinking black-box tests reach every line. Paths a tester never thinks to try stay unchecked.

## Three principles

- **Code hidden.** Only inputs and outputs count.
- **Check the spec.** Compare to what should happen.
- **User's view.** Tests it as users meet it.

## Related terms

- [White-Box Testing](https://learn.benibix.com/term/development/white-box-testing)
- [Acceptance Test](https://learn.benibix.com/term/development/acceptance-test)
- [Manual Testing](https://learn.benibix.com/term/development/manual-testing)
- [Test Case](https://learn.benibix.com/term/development/test-case)

## Told apart from

- [Black-Box Testing vs White-Box Testing](https://learn.benibix.com/compare/black-box-testing-vs-white-box-testing): Black-box testing checks what a program does from the outside, with no look at its code. White-box testing reads the code and tests each path through it. Most teams use both, for different jobs.

![Two panels. Black-box testing: an input goes into a dark closed box and an output comes out, and the tester checks only the output against what the spec says. White-box testing, lit up: the same box is open, showing its inside paths, an if with a yes branch and a no branch, and the tester writes one test for each path.](https://learn.benibix.com/diagrams/dev3-box-testing.svg)

---

Source: https://learn.benibix.com/term/development/black-box-testing
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
