Article

Black Box Testing: Techniques, Examples, and Automation

November 12, 2026

Learn black box testing techniques with practical examples. Design stronger test cases, compare testing approaches, and choose suitable automation tools.

Learn black box testing techniques with practical examples. Design stronger test cases, compare testing approaches, and choose suitable automation tools.

Black-box testing checks software behavior against its requirements without going through the code. For example, an online store allows customers to return products within 30 days of delivery. Testers can check if the website accepts eligible returns and rejects late requests. 

They can also test the same rules through an API. The challenge is deciding which test cases to select from hundreds of possible inputs. Testing all the combinations can take up so much time, and random inspections often fail to find serious defects. Black-box testing methods help testers select cases based on input limits and business rules.

This guide covers black-box testing: the main techniques, a practical product-return example, and options for manual and automated testing.

What Is Black-Box Testing?

Black-box testing is a software testing method that checks an application's behavior against its requirements, using inputs and expected outputs rather than its internal code structure.

Testers begin with a requirement which specifies how the software should behave. They then select the inputs, set the conditions for each test, and specify the expected results. The test passes when the observed behavior matches those results.

Consider a login form that locks an account after five failed password attempts. A tester can enter incorrect passwords and check the account status after each attempt. The test does not need access to the code that counts failed attempts. Its expected result comes from the login requirement.

API tests can send invalid requests and check the returned errors. Component tests can verify results from a public interface. Both manual and automated tests can use these techniques, since the expected behavior comes from the requirements. The method is also called specification-based testing.

Black-Box vs. White-Box vs. Gray-Box Testing

Black-box testing uses requirements and expected behavior and does not rely on the code. White-box testing examines the internal structure, such as branches and processing paths.

Let's say that an online shop permits returns for orders delivered within 30 days. A black-box test verifies whether a late return is rejected. A white-box test looks at the code that carries out the date comparison and exercises the branches within it.

Gray-box testing brings selected internal knowledge into the test design. A tester who knows the return service uses a separate order database may target failures between those components. They can check the result through an external interface.

Dimension Black-box testing White-box testing Gray-box testing
Test-design basis Requirements and specified behavior Internal code structure and processing External behavior informed by internal knowledge
Code knowledge Not required to select cases Required for structural test design Partial knowledge
Example Check whether a late return is rejected Test branches handling return eligibility Test the return service's interaction with order data
Coverage evidence Requirements, input groups, rules, or state changes Statements, branches, or defined code paths Depends on the chosen approach
Main limitation Cannot prove internal code-path coverage Cannot prove requirements are complete or correct Requires clarity about which internal details inform testing

The NIST definition of black-box testing recognizes its use at unit, integration, system, and acceptance levels.

Black-Box Testing Techniques and When to Use Them

Testers use different black-box techniques based on how a requirement defines valid inputs, business decisions, or state changes.

Technique When to use it Test cases produced
Equivalence partitioning Inputs belong to groups expected to behave similarly Representative values from valid and invalid groups
Boundary value analysis A rule changes at a minimum or maximum value Values at and around the limits
Decision table testing The result depends on several conditions Cases representing different business-rule combinations
State transition testing Allowed actions depend on the application's current state Valid and invalid state changes

The ISTQB Foundation Level syllabus identifies these four as core black-box techniques. A single workflow may need more than one technique. For example, an order-return feature has quantity limits that suit boundary testing and eligibility rules that suit decision tables.

Error guessing and exploratory testing can add cases that the formal techniques miss. For example, an experienced tester may decide to resubmit a form twice after a timeout since similar defects occurred in the past. ISTQB categorizes these methods as experience-based approaches.

Black-Box Testing Example: Requesting a Product Return

Let’s consider an online shop which offers returns after a product is delivered. These are the test requirements:

A signed-in customer can request a return for their own delivered order within 30 days of delivery. The return quantity must be a whole number from 1 to 5 and cannot exceed the purchased quantity. A successful submission creates a return record without issuing a refund.

For the tests, assume the customer purchased five units. The test clock is fixed on October 20, 2026, at 12:00 UTC. The 30-day period includes the exact 720-hour cutoff, but requests beyond that point are ineligible.

Equivalence Partitioning Example

Equivalence partitioning divides inputs into groups expected to produce the same behavior. Rather than testing every possible value, testers select from each group.

The return quantity has four useful groups:

Input group Sample value Expected result
Quantity below 1 0 Rejected
Whole-number quantity from 1 to 5 3 Accepted if other rules pass
Quantity above 5 6 Rejected
Non-integer or nonnumeric input 1.5 or three Rejected

Testing quantity 3 covers one representative valid input. Boundary tests check quantities 1 and 5 separately, since the application may handle either limit incorrectly. A browser field may also block letters before submission, while the API must handle invalid values received directly.

Boundary Value Analysis Example

Boundary value analysis checks the values where an application's behavior should change. For the return quantity, the valid range is 1 to 5.

Quantity Expected result
0 Rejected
1 Accepted
2 Accepted
4 Accepted
5 Accepted
6 Rejected

The two-value boundary method uses 0 and 1 at the lower limit, then 5 and 6 at the upper limit. The three-value method adds 2 and 4, giving six values altogether. 

The 30-day return window needs its own boundary tests. With the test clock fixed on October 20 at 12:00 UTC, an order delivered on September 20 at 12:00 UTC is still eligible.

An order delivered on September 19 at 12:00 UTC is 31 days old and ineligible. A test that goes just one second past the 30-day cutoff can detect errors in the time comparison.

Decision Table Testing Example

A valid quantity doesn’t mean the store should accept the return. The customer must also own the order, and the order must qualify for a return. Decision table testing is used to check the combinations of these conditions.

Signed in Owns order Eligible delivered order Valid quantity Expected action
No — — — Requires authentication; create no return
Yes No — — Deny access; create no return
Yes Yes No — Reject as ineligible
Yes Yes Yes No Reject quantity
Yes Yes Yes Yes Create return request

Here, an eligible delivered order means delivery occurred no more than 720 hours before the fixed test clock. The dash indicates that a condition does not change the expected result for that rule.

The ownership case matters because an otherwise valid request must not expose another customer’s order.. Testers should also check an order containing only two purchased units. Requesting a return of three units must fail even though three falls within the general 1-to-5 range.

State Transition Testing Example

After a return request is made, the application's response will vary according to the request's status. A canceled request should not accept the same actions as a submitted request.

Suppose the fictional store lets customers cancel submitted requests before approval and uses a request identifier to prevent duplicate records when a client retries.

Current state Event Expected result
No request Submit eligible return Request becomes Submitted
Submitted Authorized approval Request becomes Approved
Submitted Customer cancels Request becomes Cancelled
Cancelled Approval attempted Transition rejected
Submitted Same request retried No duplicate record created

A customer submits a request, but the response takes too long, and the client retries. Under the agreed retry rule, the store must not create a second return record.

A successful test has to prove the desired business outcome. When a valid return is submitted for three items, the tester should see exactly one return record with a quantity of 3 and a status of Submitted. The refund status must remain unchanged.

For rejected requests, the test should confirm that no return record was created. The order-history page or an approved return lookup endpoint can provide that evidence.

How to Create Black-Box Test Cases

To create black-box test cases, start with a clear description of what the software is supposed to do. Then choose inputs that can show any differences between the requirements and the actual behavior. Each case needs an expected result you can verify after the test runs.

  1. Choose the feature and interface under test, such as submitting a return through a website or API.
  2. Read the business rules and resolve missing details about time limits, permissions, retries, and accepted input formats.
  3. Use partitions for input groups, boundary tests for limits, and decision tables for rules with multiple conditions.
  4. Record the required account, starting data, order status, test inputs, and expected result before running each case.
  5. Identify the response or business record that proves the application accepted or rejected the requested action.
  6. Prioritize cases involving financial loss, unauthorized access, corrupted records, or frequently used business workflows.
  7. Compare actual results with expected outcomes, then record failures with their inputs and relevant supporting evidence.
  8. Update test inputs and expected results after approved requirement changes, while retaining checks for unchanged business rules.

A consistent test-case format makes reviews easier, particularly when several testers work on the same feature.

Field What to record
Case ID Stable identifier, such as RET-006
Requirement Business behavior being tested
Technique Reason for selecting the case
Preconditions Identity, order state, test data, and environment
Inputs Values and actions used during testing
Expected outcome Specific observable result
Evidence Response, UI state, or business record
Priority Business impact if the rule fails
Result Actual behavior and supporting artifacts

For the return example, RET-006 could submit quantity 6 against an eligible five-unit order. The expected result is a rejection with no new return record. If the application rejects that input correctly, the negative test passes.

The test cases should stay linked to the requirements they cover. If the return policy changes from 30 days to 45 days, the date-boundary cases will need new expected results. The ownership and quantity cases can stay as they are, because the business hasn’t changed those requirements.

Where to Run Black-Box Tests: UI, API, and Component Interfaces

In black-box testing, it is possible to apply the same requirements to different interfaces according to needed behavior. The method used for test design remains unchanged, but the evidence available changes.

UI testing verifies what users see and do in the application. A UI test can check the return form's input limits and error messages. After submission, it can also verify that the request appears in the customer's order history.

API testing checks the service contract directly. The return API can receive quantities 0 through 6 without repeating the browser steps for every value. Testers compare its responses against the contract and check the resulting return records through an approved interface.

Component interface testing examines an individual component's externally defined behavior. A return-eligibility component could accept an order status and delivery date, then return an eligibility decision. The test cases come from the specified rules rather than the component's internal branches.

Certain end-to-end tests can verify the entire process from submission to the resulting record. They are important whenever a workflow involves connected services. If the investigation uses internal database tables or code paths to select cases, that work becomes gray-box testing.

Benefits and Limitations of Black-Box Testing

Black-box testing lets teams verify software against agreed business behavior. 

Benefits of Black-Box Testing

  • Checks specified behavior: Tests compare actual outcomes with the application's stated requirements. A return request that passes its quantity check but violates the ownership rule still fails the test.
  • Supports collaboration: QA engineers can review expected outcomes with product owners before writing test cases. Business teams can verify rules without reviewing the application's source code.
  • Reveals requirement problems: Test design can reveal missing details before testing begins. A return policy stating "within 30 days" may need clarification about the cutoff time and time zone.
  • Retains useful tests after code changes: Behavioral test cases can remain valid when developers change the internal implementation. The cases need revision when the required behavior changes.
  • Works without source-code access: Testers can assess published interfaces in third-party software. API contracts and user-facing requirements provide the basis for those checks.

Limitations of Black-Box Testing

  • Incorrect requirements: A test can pass against an expected result that is itself wrong.
  • No structural coverage proof: Passing black-box cases does not show which internal code paths ran.
  • Harder root-cause analysis: A failed response may require logs or internal investigation to identify the actual defect.
  • Too many combinations: Input groups and state sequences can produce more cases than a team can run.
  • Incomplete defect detection: Passing the selected cases does not prove that the application has no remaining defects.

Black-box and white-box techniques can cover different risks within the same feature. For a return service, behavioral tests check the business rules, while structural tests examine branches the selected inputs may not reach. Together, the evidence gives developers and testers a stronger basis for judging the release.

Manual vs. Automated Black-Box Testing

Manual black-box testing involves a person performing test actions and checking results, while automated black-box testing uses software to run predefined cases and compare observed outcomes.

Testing activity Recommended approach
Repeated checks of stable business rules Good candidate for automation
Selected cross-system user journeys Automate when test data and results are repeatable
Ambiguous requirements Clarify the expected behavior before automation
Exploratory investigation Keep human judgment involved
Usability assessment Include direct human evaluation
Rare or expensive test scenarios Compare setup effort with the risk being covered

The return quantity rule is a good automation candidate, because its accepted values are clearly defined. A tester can create the cases manually and later use those inputs in an automated run. 

Exploratory work has a different purpose. A tester investigating a failed return may try unusual sequences that were never part of the original cases. Once the team understands an issue, it can add a repeatable test for that behavior.

Automation also requires reliable test data. If an earlier run already changed the order status or established a return record, a return test would show misleading results. Each run should begin with a known account and order state.

Black-Box Testing Tools and Automation Options

Various tools can run black-box tests, but how teams author and maintain tests varies. Some give developers direct control through code, while others support plain-language test creation.

Consider the product-return workflow. All four options below can help test it, but the setup and work left to the team differ.

Tool Main role Suitable use Work the team still owns
Selenium WebDriver Browser automation Code-owned web UI tests Test logic, assertions, data setup, and browser infrastructure
Playwright Test Browser and API testing Code-based web tests with controlled test environments Test design, fixtures, expected results, and maintenance
Postman API requests and response checks Testing service contracts and business-rule responses Request data, assertions, environment setup, and result review
Functionize Studio Agent-native testing through natural language Creating and running application checks without writing test scripts Requirements, coverage decisions, expected behavior, and release approval

Selenium WebDriver

Selenium WebDriver controls browsers through code. A team can write a test that signs into the store, opens an eligible order, and submits a return request. The test must include checks for the expected outcome.

Selenium suits teams that already maintain browser tests in programming languages. Teams also own the supporting test code and the infrastructure required to run it.

Playwright Test

Playwright Test supports browser tests with built-in assertions and isolated browser sessions. Developers can test the return form and make direct API requests from their tests. Its browser assertions can wait for expected conditions rather than relying on fixed delays.

Playwright suits teams that prefer to store test code alongside their application code. The team still defines the expected results and prepares reliable test data.

Postman

Postman focuses on API requests and responses. Testers can send different request quantities and use JavaScript assertions to check the status code or response body. Collections can group related requests for repeated runs.

Postman works well for API-level checks, but it does not replace browser testing of the return form. The UI still needs separate verification for user interactions.

Functionize Studio

Functionize Studio uses an agent-native approach in which testers describe application checks in natural language. Studio creates test steps and verifications, runs them, and provides results for review. Its Agent Tasks documentation also covers CSV-based test data and cross-browser runs.

Teams already using Playwright may prefer to expand their code-based tests. Functionize Studio offers a different approach for testers who want to describe application checks in natural language. Teams should compare the effort required to create tests and maintain them after application changes.

Existing test suites do not necessarily need replacing. A team may continue using Postman for service-level cases while adding browser checks through another tool.

Automating Black-Box Application Checks With Functionize Studio

The product-return workflow is a good way to assess natural language test automation. Instead of writing browser scripts, a tester can describe the required actions and expected outcomes in Functionize Studio.

Studio's agent-native testing approach starts with a plain-language description. The tester defines the behavior, and Studio creates the test and runs the application checks. The tester remains responsible for deciding which outcomes count as correct.

1. Describe the Expected Behavior

A starting test request could read:

Sign in to the store with a customer account.
Open an eligible delivered order with five items and submit a return for three.
Verify that exactly one return request exists with quantity 3 and status Submitted.
Confirm that no refund was issued.

This description identifies a business outcome rather than stopping at the submission action. Review the generated test to confirm its verifications match the approved requirement.

2. Add Valid and Invalid Inputs

The next step is to test different quantities without creating a separate workflow by hand for each case. Studio supports CSV-driven runs, where dataset rows supply values to a test.

An illustrative dataset could contain:

Quantity Expected outcome
0 Reject
1 Accept
3 Accept
5 Accept
6 Reject

The team must confirm how the dataset maps to the relevant test steps and verifications. Accepted requests also need separate starting data to avoid conflicts with previously created returns.

3. Check Application Changes and Failures

A useful assessment includes two deliberately different changes. First, move the return button to another part of the page, but keep its behavior the same. This shows whether Studio’s test maintenance handles a harmless UI change.

The second change introduces a real defect: the application accepts a quantity of 6. A rejection should still be the expected result. The test should indicate the behavior defect rather than quietly altering the expected outcome to match the application.

Studio also provides failure diagnosis and run history, which testers can review alongside the application's behavior. The release decision remains with the team.

Start testing with Functionize Studio to try a plain-language application check.

Enterprise Evaluation Checklist and Pilot

Before adopting a new testing tool for a larger project, teams need to know how it works with their actual application. A small pilot can answer more useful questions than a general feature comparison. The pilot should use a business workflow with clear requirements and known test data.

The following areas deserve review:

Area What to check
Application coverage Required web UI and service interfaces
Private application access Connection to internal test environments
Test data Preparation, isolation, and cleanup between runs
Access permissions Sign-in methods and roles allowed to change tests
Repeatable runs Consistent results from the same starting conditions
Failure evidence Inputs, relevant screenshots, responses, and run history
Maintenance Behavior after harmless UI changes
Release process How test results reach the team's release checks
Operating cost Time spent maintaining tests and cost per run

For the return process, a pilot case should include a valid submission, an invalid quantity, and a boundary case. It should also check an unauthorized request and an invalid state change. A moved UI element and a deliberately introduced business defect complete the assessment.

Before the test starts, agree on the criteria for success. The team can assess how many outcomes the tool reports correctly and the amount of effort required to maintain each case. When a run fails, it should provide enough evidence to tell the difference between defects in the application and problems with the test setup.

You can begin with Studio's free plan and assess your own application before expanding coverage.

Frequently Asked Questions

Is black-box testing manual or automated?

Black-box testing can be manual or automated because it describes how tests are designed, not how they are run.

Can black-box testing be used for APIs?

Yes, API black-box testing sends requests based on the service contract. It checks responses against expected behavior, so test cases can cover invalid inputs and business-rule failures without examining the service code.”

Can unit tests use black-box techniques?

Yes, unit tests can use black-box techniques when their cases come from the unit's specified inputs and outputs. Unit testing describes the test level, while black-box testing describes the design method.

Which black-box testing technique should I use first?

Equivalence partitioning is a useful starting point for inputs that fall into clear valid and invalid groups. Boundary value analysis adds checks around numeric or time limits. Complex business rules may need decision tables.

Does black-box testing require source-code access?

No, black-box test cases use requirements and observable behavior rather than internal code structure. Testers who already know the code can still use the method.

Can black-box testing provide complete coverage?

Black-box testing can measure coverage against selected requirements or test-design conditions, but it cannot prove that no defects remain. Finding issues outside the chosen cases takes further investigation, such as exploratory testing.

About the author

author photo: Tamas Cser

Tamas Cser

Founder & CEO

Tamas Cser is the founder, CEO, and Chief Evangelist at Functionize, the leading provider of AI-powered test automation. With over 15 years in the software industry, he launched Functionize after experiencing the painstaking bottlenecks with software testing at his previous consulting company. Tamas is a former child violin prodigy turned AI-powered software testing guru. He grew up under a communist regime in Hungary, and after studying the violin at the University for Music and Performing Arts in Vienna, toured the world playing violin. He was bitten by the tech bug and decided to shift his talents to coding, eventually starting a consulting company before Functionize. Tamas and his family live in the San Francisco Bay Area.

Author linkedin profile