Test Techniques Overview
Once you know what you're testing, you need a systematic way to figure out how to test it. This topic introduces the three categories of test design techniques - Black-box, White-box, and Experience-based - and how each one derives and measures coverage differently.
~8 min read
The core ideas, explained
Black-box Test Techniques (Specification-based)
Black-box techniques treat the software as an opaque box - you never look at the internal code, only at the inputs going in and the outputs coming out. The test basis is derived from requirements, user stories, use cases, or functional specifications, and the focus is evaluating the system's external behavior against what the business actually asked for. Coverage is measured against the test basis itself - for example, "we've tested 8 out of 10 user stories, so we have 80% requirement coverage."
Testing a search bar: the requirement says "search must return results within 2 seconds." You type a keyword (input) and verify results load in 1.5 seconds (output) - without ever looking at the SQL query powering the search.
White-box Test Techniques (Structure-based)
White-box techniques treat the software as a transparent box - you look directly into the internal architecture, data flows, and source code. The test basis is the physical codebase, architectural diagrams, or database schemas, and the focus is ensuring the internal logic, conditional paths, and structural elements actually execute correctly. Coverage is measured against structural elements executed - for example, "our tests executed 85% of the lines of code and 100% of the if/else branches."
A developer writes a function with an `if (age >= 18)` statement. Using white-box techniques, the tester explicitly designs one test with `age = 18` (triggering the "if" path) and one with `age = 17` (triggering the "else" path), so every line executes.
Experience-based Test Techniques
Experience-based techniques rely on the human element - the tester's own skills, intuition, and past knowledge - to find defects that systematic black-box or white-box techniques miss. The test basis is the tester's own knowledge, historical defect data, industry experience, and intuition about where developers commonly slip up, with the focus on anticipating errors the way real, unpredictable users might trigger them. Coverage is very difficult to measure formally, since the "test basis" lives in the tester's head - it's often tracked loosely by time spent or areas explored instead.
An experienced tester knows developers often forget to handle special characters. Without checking any requirement, they intentionally enter emojis and SQL injection characters into a "First Name" field just to see if the application crashes.
Key points to remember
- Black-box = requirements - you test what the system is supposed to do.
- White-box = code - you test how the system is built.
- Experience-based = intuition - you test based on what you know usually breaks.
- They are complementary - no single technique is perfect. The best strategies combine all three: black-box for main features, white-box for code quality, experience-based for edge-case bugs.
Terminology
A few terms from this topic worth knowing precisely.
A standardized method for deriving test conditions, test cases, and test data - a systematic strategy for covering the software instead of testing at random.
Designing tests based purely on external specifications, with no knowledge of or reference to the internal code structure.
Designing tests based on a system's internal structure or code, which requires knowledge of how the software is actually built.
A test technique category that relies on the tester's own skills, intuition, and past knowledge - including historical defect data - to anticipate where a system is likely to break.
The body of knowledge used as the source for designing tests - typically requirements, user stories, or risk analyses.
Summary
Test techniques provide a structured approach to designing test cases. Black-box techniques focus on external behavior and requirements. White-box techniques focus on internal structure and code. Experience-based techniques leverage human intuition and historical knowledge. Understanding when and how to apply these categories is the foundation of effective test design.
| Concept | One-line memory hook |
|---|---|
| Test technique | A systematic method to create test cases, rather than guessing |
| Black-box testing | Testing based on specifications (inputs & outputs) |
| White-box testing | Testing based on internal structure (code & architecture) |
| Experience-based testing | Testing based on the tester's knowledge and intuition |
| Black-box coverage | Measured by how many requirements/features were tested |
| White-box coverage | Measured by how much of the code/structure was executed |
Check your understanding
10 quick questions - click an option to see if you got it right.