Book a free call

What Is Black Box Testing? A Plain Guide

Black box testing checks software from the outside, using only inputs and outputs. Here are the techniques, the test run and the white box comparison.

Hertiv engineering teamReviewed by a senior engineer
5 min read
What Is Black Box Testing? A Plain Guide
On this page

Short answer

Black box testing is testing software from the outside, using only what the user can see and do. The tester does not look at the code: they feed in inputs, watch the outputs, and check whether the result matches the specification.

What is black box testing?

Black box testing is testing software from the outside, using only what the user can see and do. The tester does not look at the code. They feed in inputs, watch the outputs, and check whether the result matches the specification.

The name comes from treating the system as a closed box. What happens inside does not matter for the test. What matters is whether the right input gives the right output, the wrong input is handled safely, and the system behaves as the specification says it should.

Black box testing is the natural way to test from a user's point of view. A tester with the requirements document and a running build can start at once, without waiting to understand the code. That makes it the most common form of testing in product teams.

What techniques do black box testers use?

Testers use a small set of named techniques to pick cases that find bugs without testing every possible input. Each technique answers a different question about the input space.

TechniqueWhat it checksExample
Equivalence classesInputs that should behave the sameValid and invalid email addresses
Boundary valuesEdges where behaviour changesAge 17, 18 and 19 for an 18+ rule
Decision tablesCombinations of conditionsDiscount rules by member type and season
State transitionsMoves between statesLogin, lockout and reset
Error guessingLikely mistakes from experienceEmpty fields and very long text

Boundary values find the most bugs for the least effort. Off-by-one errors live at edges, so a tester always checks the value just below, at, and just above each limit.

Decision tables suit rules with several conditions at once. A discount that depends on member type, season and channel needs one case per combination, and the table shows which combinations were never tried.

How does a black box test run?

A black box test run follows a fixed shape: read the specification, design cases, run them, record what happened, and report what failed. The discipline is in writing the case before running it, so the expected result is decided in advance.

  1. Read the requirement and note what the feature must do.
  2. List the inputs, the valid ranges and the error cases.
  3. Write each case with steps, input data and the expected result.
  4. Run the cases on the build and record the actual result.
  5. Log failures with steps to repeat them.
  6. Re-test the fixes and check that nothing else broke.

The expected result is the heart of the method. A test without a written expected result is only a tour of the product, and it cannot tell you whether the software is right. Re-testing fixes is the idea behind smoke testing vs regression testing, where a short check confirms the build still works after a change.

Black box vs white box vs grey box

Black box, white box and grey box testing differ in how much the tester can see. Black box testers see only the interface. White box testers read the code and test paths inside it. Grey box testers know something about the internals, such as the database or the API, and use that to design better cases.

ApproachWhat the tester seesBest for
Black boxInputs and outputs onlyUser-facing behaviour
White boxCode, branches, pathsLogic and coverage
Grey boxInterfaces plus some internalsIntegration and data flows

Most teams use all three. Black box testing catches what the user will hit. White box testing catches logic the interface never reaches. Grey box testing sits between them and is common in integration work.

Example (hypothetical): testing a login form

Example (hypothetical): a team tests the login form of a banking app. The specification says the form accepts an email and a password of 8 to 64 characters, locks the account after 5 failed tries, and shows a clear error for each problem.

The tester writes 40 cases: valid logins, wrong passwords, locked accounts, empty fields, passwords of 7, 8, 64 and 65 characters, and very long input. The run finds 6 failures, including a password of 65 characters that the form accepts and a lockout message that never appears. The team fixes the two faults and re-runs the 40 cases, plus 5 new ones for the fixes.

The boundary cases did the most work. The 7, 8, 64 and 65 character passwords are only 4 of the 40 cases, but they found the acceptance fault that the happy-path cases missed. The lockout fault came from a state case: five wrong passwords in a row, then a correct one, which the form accepted instead of blocking.

When is black box testing the right choice?

Black box testing is the right choice when the requirement is clear and the user experience is what matters. Acceptance testing, system testing and most user-facing checks are black box work, and they sit alongside the custom software development process. The tester needs the requirement and the build, not the code.

It is the wrong tool when the bug is inside the logic and the interface never reaches it. A calculation that is wrong for one rare input needs white box tests or targeted unit tests, not more clicks on the screen.

Security testing is a special case. Testers probe the outside of the system without the code, which is exactly how an attacker works. That is why penetration testing is usually a black box activity.

What are the common mistakes?

The most common black box testing mistakes are testing only the happy path, writing cases after running them, and treating a pass as proof the software is correct.

  • Only valid inputs, so error handling is never checked.
  • No written expected result, so failures are argued about after the run.
  • Testing every value instead of using boundaries and equivalence classes.
  • Skipping re-tests, so a fix that breaks something else goes unnoticed.
  • Treating a green run as proof, when it only proves the cases that were written.

A useful rule is to spend as much time on the cases as on the run. The run is the easy part. Choosing what to check is the work that finds bugs. Teams that build testing into delivery usually pair it with DevOps services so tests run on every change.

Key takeaways

  • Black box testing checks inputs and outputs without looking at the code
  • Boundary values and equivalence classes find the most bugs for the least effort
  • Every case needs a written expected result before it is run
  • Black box, white box and grey box testing catch different bugs
  • A passing run proves only the cases that were written, not the whole product

Frequently asked questions

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

Black box testers see only the interface and test behaviour against the specification. White box testers read the code and test paths inside it. Most teams use both, because each catches bugs the other cannot reach.

Who does black box testing?

Usually a tester or QA engineer, but developers and product owners do it too. Anyone with the requirements and a running build can test from the outside, which is why it is the most common form of testing in product teams.

Is black box testing the same as manual testing?

No. Black box describes what the tester can see, while manual describes how the test is run. Black box tests can be automated, and many teams automate their black box checks so they run on every change.

How many test cases are enough?

There is no fixed number. Good coverage comes from the techniques: equivalence classes to group inputs, boundary values at the edges, and decision tables for combinations. A small set chosen well beats a large set chosen at random.

Can black box testing find security problems?

It can find some, such as missing input checks and weak error handling. But deep security work needs dedicated methods, including penetration testing, where testers probe the system the way an attacker would.

What should a test case contain?

A test case needs steps, input data and the expected result, written before the run. Without the expected result, the tester cannot tell whether the software is right, and failures turn into arguments instead of fixes.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: software products in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a product and need testing that catches what users will hit? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Custom Software Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call