Software Modernisation
Black Box vs White Box Testing and Reverse Engineering: What's the Difference?
Published on 27 July 2026 | 8 min read
Software teams have two basic ways to look at an application. They can treat it as a sealed box and judge it only by what it does. Or they can open it up and examine how it works inside.
These are black box and white box approaches. They are mostly discussed as testing methods, but the same terms come up when organisations talk about reverse engineering an old system. That overlap causes confusion, especially when a project’s budget and legal position depend on which one you mean.
This article explains each approach, compares them side by side, and shows how they work together on a real-world style example.
What is black box testing?
Black box testing checks what software does from the outside, without looking at the code. The tester knows what the system should do, provides inputs, and checks the outputs against the specification.
Take a login form. A black box tester would try:
- A correct email and password: the user should reach the dashboard.
- A correct email with the wrong password: an error, without saying which field was wrong.
- An unregistered email: the same error, so attackers cannot discover valid accounts.
- Five wrong attempts in a row: the account should be temporarily locked.
- An empty form, a very long input, or special characters: a clean validation message, never a crash.
The tester does not need to know whether the system uses Laravel, Java or anything else. Common techniques include equivalence partitioning (testing one value from each group of similar inputs), boundary value analysis (testing at the edges, such as exactly 18 and 17 years old), and end-to-end testing with tools such as Playwright.
What is white box testing?
White box testing examines the software from the inside. Developers read the code and write tests that exercise its internal logic: functions, branches, loops and paths.
In a Laravel application, this usually means unit and feature tests written with PHPUnit or Pest. For example, a leave calculation service might have tests that check:
- An employee with less than a year of service gets a pro-rated entitlement.
- Carried-forward leave is capped at the policy maximum.
- The branch that handles public holidays falling on a weekend is actually executed.
Because the developer can see the code, they can measure code coverage and target branches that black box testing might never reach.
Black box vs white box testing comparison
| Aspect | Black box testing | White box testing |
|---|---|---|
| Source code access | Not required | Required |
| Testing focus | External behaviour against requirements | Internal logic, paths and branches |
| Typical users | QA testers, business analysts, end users in UAT | Developers |
| Common techniques | Equivalence partitioning, boundary values, end-to-end and acceptance testing | Unit tests, branch and path coverage, code review, static analysis |
| Advantages | Tests from the user’s view; no programming knowledge needed; independent of the technology | Finds hidden logic errors; measures coverage; catches problems early |
| Limitations | Can miss untested internal paths; hard to locate the cause of a failure | Needs code and skilled developers; can miss missing features |
| Example scenario | Checking a claims form rejects a claim above the limit | Testing every branch of the claims approval function |
Neither is “better”. Black box testing tells you whether the system meets its requirements. White box testing tells you whether the code is sound. Good projects use both.
What is software reverse engineering?
Reverse engineering is different from testing. Testing checks a system against a specification you already have. Reverse engineering works backwards from an existing system to recover its specification: what it does, how its data is structured, and how it connects to other systems.
It draws on whatever authorised evidence is available:
- The user interface and observed behaviour (a black box approach).
- Documentation, user manuals and old project files.
- Database schemas and data, which often reveal business rules.
- Interfaces, such as APIs, file exports and integration logs.
- Source code or binaries, where you have the right to examine them.
When reverse engineering relies only on observed behaviour, it is often called black box analysis. Our guide to black box software development explains that process in detail.
A legal note: computer programs are protected as literary works under Malaysia’s Copyright Act 1987, and licence agreements often restrict decompiling or analysing software. Make sure you have the right to examine a system before you start, and take legal advice where the position is unclear.
Practical example: an HR management system
An illustrative scenario.
A company runs an HR system built by a vendor that no longer supports it. It covers employee records, leave, attendance, claims and approval workflows. The company wants a replacement.
Black box analysis. Analysts sit with HR staff, managers and employees. They record how each module behaves: which fields an employee record requires, how leave balances change after an application is approved, what happens when a claim exceeds a limit, and who approves what when a manager is on leave.
White box analysis. The company still has read access to the database. Engineers examine the tables and find that leave entitlement depends on a “grade” field and a service-years calculation that no HR staff member mentioned, because it runs automatically. This is a hidden rule that black box analysis alone might have missed.
Requirements engineering. Both sets of findings go into a Software Requirement Specification, with acceptance criteria for each rule: “An employee in grade 3 with five years’ service is entitled to 18 days’ annual leave.”
Testing. During development, white box tests (PHPUnit or Pest) check the leave calculation code directly. Before go-live, black box acceptance tests run the same scenarios through the old and new systems and compare results. HR staff then complete user acceptance testing.
To see how this fits into a full replacement project, read how to rebuild software without source code.
What is grey box testing?
Grey box testing sits in between. The tester has partial knowledge of the internals, such as the database structure, API documentation or the architecture, but tests mainly through the external interface.
For example, a tester submits a leave application through the screen (black box), then checks the database directly to confirm the balance and audit records were written correctly (partial white box). Grey box testing is common for integration and security testing, and it is often how legacy systems are analysed in practice: some internal access, but not all.
Which approach should your organisation use?
It depends on what you have and what you are trying to achieve:
- Building new software: use both. Developers write white box tests; QA and users run black box and acceptance tests.
- Buying or accepting a system from a vendor: black box acceptance testing against your requirements is essential, even if you never see the code.
- Analysing an old system without source code: black box analysis, plus grey box techniques if you can access the database or interfaces.
- Inheriting code from another team: white box review first, to see what you are dealing with, then black box tests to protect current behaviour before you change anything.
How Tarsoft applies software engineering practices
On the systems we build in Laravel and Flutter, we work from documented requirements with acceptance criteria, write automated tests as part of development, run functional and integration testing, and support clients through user acceptance testing before go-live. For existing systems, we start with an assessment that combines black box analysis with whatever internal access is available. See the systems we build.
If your own team wants to build these skills, our Playwright testing course covers end-to-end testing for Laravel and Flutter applications.
Frequently asked questions
Is black box testing the same as reverse engineering?
No. Black box testing checks software against a specification you already have. Reverse engineering recovers the specification from an existing system. Black box analysis, which observes behaviour without code, is one reverse engineering technique.
Does white box testing require source code?
Yes. White box testing relies on knowing the internal logic, so it needs access to the source code, or at least detailed knowledge of the internals.
Can both approaches be used together?
Yes, and they should be. White box tests check the code is correct; black box tests check the system does what users and the business need.
What is grey box testing?
Testing with partial knowledge of the internals, such as the database schema or API documentation, while testing mainly through the external interface. It is common for integration and security testing.
Which method is useful when source code is unavailable?
Black box analysis and testing, supported by grey box techniques if you can access the database, files or interfaces.
Need help assessing an existing application?
Whether you have the code or not, an assessment shows what your system really does and what your options are. Talk to Tarsoft about your software project.
- #Black Box Testing
- #White Box Testing
- #Software QA
- #Reverse Engineering