# Black box testing

> Black Box Testing: What It Is and When to Use It. Canonical page: <https://zapple.tech/glossary/black-box-testing/>

Black box testing checks what software does against its specification, without looking at the code. You give it inputs and compare the outputs with what the requirements say. It suits system and acceptance checks and works for outside teams, but it cannot show you which parts of the code no test has run.

## What is black box testing, and how does it differ from white box testing?

In black box testing, you design tests from what the software should do, not from how it is built. [NIST's glossary](https://csrc.nist.gov/glossary/term/black_box_testing) defines it as a method that "examines the functionality of an application without peering into its internal structures or workings". The [ISTQB foundation syllabus](https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf) adds that the test cases are independent of how the software is implemented, so "if the implementation changes, but the required behavior stays the same, then the test cases are still useful".

White box testing is the opposite design choice. The same syllabus says it derives tests "from the system's implementation or internal structure" and aims to cover that structure. Black box asks whether the product does what it should. White box asks how much of the code the tests reached. Neither replaces the other. For the other half, see [white box testing](/glossary/white-box-testing/).

## What are the black box testing techniques?

A system has more possible inputs than you can try. A technique is a rule for picking a small set that still catches the likely faults. The syllabus names four. The examples in the table are ours, for illustration.

| Technique | What it is for | A plain example |
|:--|:--|:--|
| Equivalence partitioning | Splitting inputs into groups the system should treat the same, then testing one value per group | A ticket price depends on age: child, adult, senior. Test one age from each band |
| Boundary value analysis | Testing the edges of those groups, because developers "are more likely to make errors with these boundary values" | Test the last child age and the first adult age, not only the middle |
| Decision table testing | Requirements where "different combinations of conditions result in different outcomes" | A shipping fee depends on country, order total and membership. List each combination |
| State transition testing | Behavior that depends on the sequence of events, modeled as "possible states and valid state transitions" | An order moves from placed to paid to shipped. Try shipping an order that is not paid |

The syllabus says these techniques sit in a group of their own, separate from white box and experience-based ones. Use case testing is not among the black box techniques in the current foundation syllabus, so the table leaves it out.

## When is black box testing enough, and when do you need to look inside the code?

Our rule of thumb: black box is enough when the question is "does it do what we agreed?" That covers acceptance checks, release checks and any product you cannot read the code of, such as a vendor's system. It also fits tests written the way a user acts. [Playwright's guidance](https://playwright.dev/docs/best-practices) says tests should "verify that the application code works for the end users" and avoid "implementation details such as ... the name of a function". The [Selenium documentation](https://www.selenium.dev/documentation/) describes tools that "emulate user interaction with browsers". The API side works the same way: Playwright's [API testing guide](https://playwright.dev/docs/api-testing) covers sending requests to your server and checking what comes back.

Add white box when the risk sits in the code, not in the behavior. A black box [test suite](/glossary/test-suite/) can be green while a branch of code has never run. If you want to see what a static review can find without running anything, read our page on [static testing](/glossary/static-testing/). For how the two designs work with Selenium, see [automated black and white box testing](/blog/test-automation-frameworks/how-to-automate-white-and-black-box-testing-using-selenium/).

## What is gray box testing?

[NIST's glossary](https://csrc.nist.gov/glossary/term/gray_box_testing) defines gray box testing as a methodology that "assumes some knowledge of the internal structure and implementation detail" of the thing tested. Our reading: you know the data model or the API contract, but you still test through the interface.

## Can an outside team do black box testing well, and what do they need from you?

Yes. In our judgement it is a good fit: the tests start from the specification, so no code access is needed. If you want that run for you, see our [functional testing services](/services/functional-testing-services/).

What an outside team needs from you, in our judgement from practice:

- **A specification they can derive expected results from.** If a requirement says "fast" or "easy to use", they will ask or guess. Acceptance criteria with concrete values work better.
- **A stable test environment.** A shared environment that changes under them produces failures that are not defects.
- **Test data and accounts.** Include the awkward cases: expired, empty, maximum and invalid.
- **A person who answers questions about expected behavior,** within a day, not at the end of the sprint.
- **Access to your defect tracker,** so findings reach the people who fix them.

Our rule of thumb: the quality of black box testing is capped by the quality of the specification. For how acceptance testing fits in, see [what is user acceptance testing](/blog/types-of-automation-testing/what-is-user-acceptance-testing/).

## What does Zapple.Tech do about it?

If you are not sure how well your product is specified or tested from the outside, start with evidence. Zapple.Tech starts with a one-week QA audit of one product area. It looks at its tests, pipeline and release process, and ends in a written report on what is at risk and what to fix first, plus a pilot plan you can run with Zapple.Tech or without it. Read more on the [QA audit and assessment](/services/audit-and-assessment/) page.

Tell us about your product in the form below.

## FAQ

### What is black box testing?

Black box testing derives tests from the specification, not from the code. The tester feeds inputs to the system and checks the outputs against the required behavior. The ISTQB foundation syllabus calls it specification-based and says its main objective is checking the system's behavior against its specifications.

### What is the difference between black box and white box testing?

Black box testing designs tests from the specified behavior without reference to the internal structure. White box testing designs them from the code, architecture or data flows, and aims to cover that structure to an acceptable level. Black box asks whether the product does what it should. White box asks whether the tests exercised the code.

### What are the black box testing techniques?

The ISTQB foundation syllabus names four black box techniques. They are equivalence partitioning, boundary value analysis, decision table testing and state transition testing. Each helps you pick a small set of test cases from an input space that is too large to test fully.

### Is black box testing manual or automated?

Either. Black box describes how the tests are designed, not how they run. A person can run them by hand, or a tool can drive a browser or call an API. Tests that use only what a user can see or an API returns are black box in design, whether or not a person runs them.

### What is gray box testing?

Gray box testing sits between the two. NIST's glossary defines it as a test methodology that assumes some knowledge of the internal structure and implementation detail of the thing under test. A tester might know the data model or the API contract while still testing through the interface.

## Sources

- [ISTQB Certified Tester Foundation Level syllabus v4.0.1 (newest edition listed by ISTQB, dated 2024-09-15)](https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf)
- [NIST CSRC Glossary, black box testing](https://csrc.nist.gov/glossary/term/black_box_testing)
- [NIST CSRC Glossary, gray box testing](https://csrc.nist.gov/glossary/term/gray_box_testing)
- [Playwright documentation, Best practices (current docs)](https://playwright.dev/docs/best-practices)
- [Playwright documentation, API testing (current docs)](https://playwright.dev/docs/api-testing)
- [Selenium documentation, Overview (current docs)](https://www.selenium.dev/documentation/)
