Skip to content
Bugwise
Menu
Testing Fundamentals

Black, White and Grey Box

The three ways to look at software when you test it (from the outside, from the code, or with a peek inside) plus experience-based testing, and when a manual tester uses each.

beginner Mobile & web
Short on time? Switch to the quick version.

Picture a coffee machine in an office. Anyone can test it: put in a cup, press Cappuccino, taste the result. The service technician tests it differently: they open the maintenance panel and read the water temperature and the error log. And the engineer who designed it can open the case and look at every pipe and circuit.

Same machine, three levels of “seeing inside”. Software testing has exactly the same three views, and they have names: black box, grey box and white box.

Part Not started

The three boxes in one picture

■

Black box

You see inputs and outputs only. Tests come from requirements and user expectations.

Typical: manual testers, UAT

◧

Grey box

You test from the outside, but use some inside knowledge: the messages the app sends to its server (API calls), the stored data (the database), the app’s record of errors (logs).

Typical: modern manual testers

□

White box

You see the code itself and design tests so every line and branch runs.

Typical: developers, unit tests

Check this part

  1. In grey-box testing, what do you use besides the user interface?

  2. Who typically does white-box testing?

Black box sees inputs and outputs, grey box adds some inside knowledge, white box sees the code itself.

Part Not started

Black-box testing: from the outside

Black-box testingBlack-box testingTesting based only on inputs and outputs, without looking at the code.Open in glossary → treats the app as a sealed box. You put something in (tap, type, swipe) and check what comes out, compared with the requirementsRequirementA statement of what the software must do or how well it must do it.Open in glossary →. You don’t need to know how it works inside. Most manual testing is black box.

Black-box testers use structured techniques to choose good inputs: equivalence partitioning, boundary value analysis, decision tables and state transition testing.

Because the tests come from the requirements, black box is the approach that notices when a required feature was never built at all.

Black-box testingBlack-box testingTesting based only on inputs and outputs, without looking at the code.Open in glossary → means testing the app without looking at how it’s built. You know what goes in and what should come out; what happens in between is a closed box.

Where black-box tests come from

Your “source of truth” is everything that describes how the app should behave:

Black-box techniques

Because you can’t test every input, black-box testing has a toolbox of techniques for picking the inputs most likely to find bugs. Each has its own lesson:

TechniqueCore ideaExample
Equivalence partitioningGroup inputs that behave the same, test one from each groupAge 25 stands for every adult age
Boundary value analysisBugs gather at the edgesTest €49.99, €50.00 for a “€50 or more” rule
Decision tablesTest every combination of conditionsMember? × order ≥ €30? × rainy day?
State transitionTest moves between statesOrder: placed → paid → shipped → delivered
Use case testingFollow a full user journey, plus its alternativesSearch → add to cart → pay → receipt

Use case testing means walking through a complete scenario the way a real user would (the “happy path”), then each alternative and error path: card declined, address missing, app sent to the background mid-payment. It’s how most end-to-end test scenariosTest scenarioA high-level idea of what to test, such as 'User resets a forgotten password'.Open in glossary → in feature lessons are built.

Strengths and limits

Black-box testing finds what users will actually run into: wrong totals, confusing messages, broken flows, missing features. It needs no programming skills, and it catches missing behavior: if the requirement says “send a receipt by email” and the code never does, a test designed from the code can’t notice, but a test based on the requirement will.

Its blind spot: code paths that no requirement mentions. If a developer left a secret “STAFF50” discount code in the app, no requirement-based test will ever try it. That’s where the other boxes help.

Check this part

  1. A tester checks a sign-up form only against the acceptance criteria, without knowing anything about the code. Which approach is this?

  2. Which bug is black-box testing best at finding?

Test what the user sees, against the requirements, without knowing how the app works inside.

Part Not started

White-box testing: from the code

White-box testingWhite-box testingTesting based on knowledge of the internal code and logic.Open in glossary → designs tests by reading the code. The goal is coverage (how much of the code the tests actually ran): making sure every line (statement coverageStatement coverageThe percentage of code statements executed at least once by the tests.Open in glossary →) and every “yes/no” path of each if (branch coverage) has been run by at least one test. Developers usually do this with unit testsUnit testingTesting the smallest pieces of code, like a single function, usually by developers.Open in glossary →.

Coverage shows what code ran, not whether the result was right or whether required behavior is missing. That’s why white box never replaces black box.

White-box testingWhite-box testingTesting based on knowledge of the internal code and logic.Open in glossary → designs tests from the internal structure of the code. The tester (usually the developer) reads the code and chooses inputs that make specific lines and paths run.

Statement and branch coverage, simply

Coverage (here it means code coverage) measures how much of the code your tests actually executed. The two kinds every tester should understand:

  • Statement coverage: the percentage of code lines (statements) that ran at least once.
  • Branch coverage: every decision (if) has two exits, true and false. Branch coverage is the percentage of those exits your tests went through.

Here is a tiny piece of pseudo-code for a gym app’s late-cancellation fee:

1  if hoursBeforeClass < 12:
2      fee = 5
3  show "Cancellation fee: €" + fee
  1. One test: cancel 2 hours before. The if on line 1 is true, so lines 1, 2 and 3 all run. That’s 100% statement coverage, because every line ran. But only the true exit of the if was taken: 50% branch coverage.
  2. Add a second test: cancel 24 hours before. Now the if is false and line 2 is skipped. Together, the two tests took both exits: 100% branch coverage.
  3. Why it matters. Look at what the second test shows: “Cancellation fee: €undefined”, because fee is never set on the false path (“undefined” is what some apps print when a value was never set). Test 1 alone had 100% statement coverage and completely missed this bug. Only the branch-coverage test found it.
  4. The rule. Branch coverage is stronger than statement coverage: 100% branch coverage always gives 100% statement coverage, but not the other way around.

Who does white-box testing?

Mostly developers, through unit testsUnit testingTesting the smallest pieces of code, like a single function, usually by developers.Open in glossary → and code reviews, and coverage tools report the percentages automatically. As a manual tester you’ll rarely write white-box tests, but white-box thinking still helps you:

Check this part

  1. One test runs every line of a function, but each if only ever went the 'true' way. What do you know?

  2. Why can't 100% code coverage guarantee the app is correct?

Design tests from the code so every line (statement coverage) and every true/false exit (branch coverage) runs.

Part Not started

Grey-box testing: outside, with a peek inside

Grey-box testingGrey-box testingTesting from the outside with some knowledge of the inside, like the database or API.Open in glossary → is the middle ground: you still test through the UI, but you also look at the messages the app sends to its server (APIAPIThe way different software parts talk to each other, like an app asking a server for data.Open in glossary → calls) in DevToolsDevToolsDeveloper tools built into browsers for inspecting pages, network traffic and errors.Open in glossary →, check the stored data in the databaseDatabaseAn organized store of an app's data, such as users, orders and payments, kept on a server.Open in glossary →, read logs (the app’s record of events and errors), or use what you know about how the system is built. It lets you find bugs the screen hides and write much sharper bug reports. It’s a big part of a modern manual tester’s job.

Grey-box testingGrey-box testingTesting from the outside with some knowledge of the inside, like the database or API.Open in glossary → mixes the two. You still test from the outside, usually through the user interface like a user, but you use partial knowledge of the inside to choose better tests and to check results the screen doesn’t show.

What “inside knowledge” looks like in practice

What you look atToolWhat it reveals
API requests and responsesDevTools, PostmanThe real data sent and received, status codesHTTP status codeA three-digit number in every server response: 200 means OK, 404 not found, 500 server error.Open in glossary →, hidden errors
Mobile app trafficProxy tools (Charles, Proxyman)The same, for iOS and Android apps
The databaseDatabaseAn organized store of an app's data, such as users, orders and payments, kept on a server.Open in glossary → (where the app stores its data)A database tool, admin panelWhether the order, refund or status was really saved
Logs (the app’s record of events and errors)DevTools Console, logcatLogcatAndroid's system log, read with adb logcat, where apps write errors and crash details.Open in glossary →, Xcode console, server logsErrors and warnings behind a vague UI message
The architecture (how the parts of the system are connected)Talking to developers, diagramsCaches, background jobs, third-party services: where things can break

A grey-box bug story

A tester on a travel app books a hotel. The screen says “Booking confirmed!”, which looks perfect from a black-box view. But in the browser’s Network panel (the list of messages between the app and its server) they see that the payment request failed with error code 500, which means the server hit an error. A quick look in the test database confirms it: booking saved, payment status FAILED. The customer would have arrived at a hotel with no payment.

Without grey-box knowledge, that bug report would say “seems fine”. With it, the report names the failing endpointEndpointA specific API address the app calls, like GET /api/products or POST /api/login.Open in glossary →, includes the response body, and the developer fixes it in an hour. See writing bug reports for how to attach this evidence.

Check this part

  1. Your app shows 'Payment successful', and you open DevTools to confirm the payment request really succeeded and the order was saved. Which approach is that?

  2. Do you need to write code to do grey-box testing?

Test through the UI, but check API calls, the database and logs to find bugs the screen hides.

Part ProNot started

Experience-based techniques: the fourth family

The fourth family isn’t about the box at all. (ISTQB names three families of techniques: black-box, white-box and experience-based. Grey box is an everyday industry word for mixing the first two.) Experience-based techniques use the tester’s knowledge and intuition: guessing likely errors (names with apostrophes, double taps on Pay), exploratory testingExploratory testingLearning, designing and running tests at the same time, guided by curiosity and a goal.Open in glossary →, and working through checklistsChecklistA simple list of things to check, lighter and faster to use than full test cases.Open in glossary →.

Not every good test comes from a document or from code. Experience-based techniques use the tester’s knowledge of where software usually breaks. ISTQB names three families of test techniques: black-box, white-box and experience-based. Grey box is an everyday industry word for mixing the first two. The experience-based family has three techniques:

These work best on top of structured techniques: the structured ones make sure you cover the requirements, the experience-based ones catch what nobody wrote down.

Check this part

  1. You type a surname with an apostrophe because you know many apps break on it. Which technique is this?

  2. What do experience-based techniques rely on?

Error guessing, exploratory testing and checklists use the tester's knowledge of where software usually breaks.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Part ProNot started

Putting the approaches together

Strong testing combines all four on the same feature. Take a promo code field at checkout: black box tests the rules from the requirement (€49.99 and €50.00, invalid and expired codes); grey box checks with DevTools that the response returns the right discount and the order stores the discounted total; developers’ white-box unit tests cover each branch of the discount function; and experience-based tests try a code with a trailing space or two codes applied quickly.

Comparing the approaches

Based onWho usuallyFinds best
Black boxRequirements, user viewTesters, users (UAT)Wrong or missing behavior
White boxCode structureDevelopersUntested code paths, logic slips
Grey boxPartial inside knowledgeTesters, often with dev helpHidden failures, data and API bugs
Experience-basedTester’s knowledgeExperienced testersUnexpected, “nobody thought of that” bugs

How they work together on one feature

Let’s say a food delivery app adds a promo code field at checkout.

  1. Black box first. From the requirement “SAVE10 gives 10% off orders of €50 or more”, test €49.99 and €50.00, an invalid code, an expired code, lower-case “save10”.
  2. Grey box alongside. With DevTools or a proxy open, check the request sends the code, the response returns the right discount, and the order row in the database stores the discounted total, not the original.
  3. White box from the developers. Unit tests cover each branch of the discount function; the coverage report shows one uncovered branch for “STAFF50”, which leads to a conversation: should that code even be live?
  4. Experience-based to finish. Paste a code with a trailing space, apply two codes quickly, apply a code then empty the cart, switch apps mid-checkout.

Common misconceptions

  • “Black box is the beginner’s version.” No. Designing strong black-box tests is a real skill, and it’s the approach that catches missing features, because code-based tests can’t cover code that was never written.
  • “White box means 100% coverage, so we’re done.” Coverage shows what ran, not what’s correct or missing.
  • “Grey box needs programming.” Reading a network request or running a simple database query is a learnable skill that needs no coding.
  • “Exploratory testing is random clicking.” Good exploratory testing has a goal, a time box and notes.

Check this part

  1. For the promo code field, which approach checks that the order stores the discounted total, not the original?

  2. Who covers each branch of the discount function?

Strong testing combines all four approaches on the same feature.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Try it: see inside the box

Below is one small checkout feature from a pizza delivery app. Switch between the three views and run some tests. In white box mode, try to reach 100% branch coverage with as few tests as you can, and look carefully at what the code does that the requirements never mention.

See inside the box

One feature, three views. Run a few tests in each mode and notice what extra information you get as the box becomes transparent.

You see only what a customer sees: the screen, your inputs and the result. Your tests come from the requirements.

Requirements (all you get in black box)

  • Delivery costs €2.99.
  • SAVE10 gives 10% off orders of €50 or more.
  • FREESHIP makes delivery free.
  • Members always get free delivery.
  • Unknown codes show an error.

Checkout · PizzaGo

Run a test to see the result.

Try:

The inside is hidden

You know the inputs (subtotal, code, member) and the output (the total or an error). Is the error message helpful? Is €50 exactly accepted? You can only find out by trying.

Which approach is this?

Which approach is this?

Pick the best fit for each test. You get instant feedback.

0/9 correct
  1. 1.Using only the spec, you try order totals of €49.99, €50.00 and €50.01 to see exactly where the SAVE10 code starts working.

  2. 2.After tapping Pay, you open the Network tab in DevTools and check that the request sends the amount in cents (4999) and not as 49.99.

  3. 3.A developer writes unit tests so that both the “if” and the “else” of the late-payment fee rule run at least once.

  4. 4.Without a script, you spend 45 minutes on the new in-app chat: emojis, a 5,000-character message, airplane mode mid-send, rotating the phone.

  5. 5.From the requirements, you list every combination of “member?”, “order ≥ €30?” and “rainy day?” and test each one.

  6. 6.Because apps often trip over apostrophes, you sign up as “Seán O’Brien” and check the name on the receipt.

  7. 7.You cancel an order in the app, then query the test database to confirm the order’s status changed to CANCELED and the refund row was created.

  8. 8.Reading a pull request, you notice a new branch for “country == UK” that none of the existing tests execute, and design an input for it.

  9. 9.Knowing the product list is cached for 5 minutes, you change a price in the admin panel and time how long the old price stays visible in the app.

Practice: four views of a password reset

Here is a small spec for a banking app:

“On the login screen, Forgot password? asks for an email. If the email belongs to an account, we send a reset link valid for 30 minutes. For security, the screen always shows: If an account exists, we’ve sent you an email.”

Write down one test idea for each approach: black box, grey box, white box and experience-based. Then compare with the examples below.

Show example answers

Black box: Request a reset for a registered email, wait 31 minutes, open the link: it must say the link has expired.

Grey box: Request a reset for an unregistered email and check in DevTools that the API response is identical to the registered case (same status code, same body). Otherwise attackers can find out who has an account.

White box: A developer’s unit tests cover both branches of “account exists?” and both branches of “link older than 30 minutes?”.

Experience-based: Request two resets in a row and try the first link (should old links still work?), or enter the email with capital letters and a trailing space.

Key takeaways

  • Black box tests behavior from the outside, based on requirements. It’s what manual testers do most, using techniques like equivalence partitioning, boundaries, decision tables and state transitions.
  • White box designs tests from the code. Statement coverage counts lines run; branch coverage counts true/false exits taken and is the stronger measure.
  • 100% coverage shows what ran, not what’s right or what’s missing.
  • Grey box is outside testing with inside knowledge (API responses, the database, logs, architecture), and it’s a core skill for modern manual testers.
  • Experience-based techniques (error guessing, exploratory testing, checklists) catch what no document mentions.
  • Strong testing combines all four on the same feature.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.