Black-Box Test Techniques

.
Software Testing / Chapter 04 01 / 07

Black-Box
Test Techniques.

EP · BVA · Decision Tables · State Transition
Based on an analysis of specified behavior.
◉ ISTQB FOUNDATION · SECTION 4.2
The techniques · four approaches 02 / 07
Commonly used black-box test techniques

Test cases are independent of how the software is implemented.

If the implementation changes, but the required behavior stays the same, the test cases are still useful. These techniques help develop a relatively small, but sufficient, set of test cases in a systematic way.

4.2.1
Equivalence Partitioning
EP
4.2.2
Boundary Value Analysis
BVA
4.2.3
Decision Table Testing
DT
4.2.4
State Transition Testing
ST
4.2.1 · Equivalence Partitioning 03 / 07
Divide and conquer

All elements of a given partition are processed in the same way.

If a test case that tests one value from an equivalence partition detects a defect, this defect should also be detected by test cases that test any other value from the same partition.

Partitions can be identified for inputs, outputs, configuration items, internal values, time-related values, and interface parameters. They may be continuous or discrete, ordered or unordered, finite or infinite.

Valid partitionsVALID
Invalid partitionsINVALID
Partitions must not overlapRULE
Partitions must be non-emptyRULE
Each Choice coverageMULTI
Coverage is measured as the number of partitions exercised by at least one test case, divided by the total number of identified partitions.
4.2.2 · Boundary Value Analysis 04 / 07
Where defects hide

Developers are more likely to make errors with boundary values.

BVA can only be used for ordered partitions. Typical defects are misplaced boundaries — implemented above or below their intended positions, or omitted altogether.

2-value BVA

Boundary +
closest
neighbor.

For each boundary value, two coverage items: the boundary value and its closest neighbor belonging to the adjacent partition.

versus
3-value BVA

Boundary +
both
neighbors.

Three coverage items: the boundary value and both its neighbors. More rigorous — may detect defects overlooked by 2-value BVA.

If "if (x ≤ 10)" is incorrectly implemented as "if (x = 10)", no test data from 2-value BVA (x=10, x=11) can detect it. But x=9, from 3-value BVA, is likely to detect it.
4.2.3 · Decision Table Testing 05 / 07
Complex logic and business rules

How different combinations of conditions result in different outcomes.

Conditions and resulting actions form the rows. Each column corresponds to a decision rule that defines a unique combination of conditions, along with the associated actions.

The strength of decision table testing is that it provides a systematic approach to identify all the combinations of conditions, some of which might otherwise be overlooked. It also helps to find any gaps or contradictions in the requirements.

Notation
TCondition is satisfiedTRUE
FCondition is not satisfiedFALSE
Value is irrelevantDON'T CARE
N/ACondition is infeasibleIMPOSSIBLE
XAction should occurFIRE
4.2.4 · State Transition Testing 06 / 07
Modeling system behavior

Possible states and valid transitions.

A transition is initiated by an event, which may be additionally qualified by a guard condition. Transitions may result in the software taking action. Common syntax: "event [guard condition] / action".

A state table explicitly shows invalid transitions, represented by empty cells. Testing only one invalid transition in a single test case helps to avoid defect masking.

Coverage criteria hierarchy
LEVEL / 01
All states
Weakest. All states must be exercised. Can be achieved without exercising all transitions.
↓ stronger
LEVEL / 02
Valid transitions
Also called 0-switch coverage. All valid transitions exercised. Most widely used. Guarantees all states.
↓ strongest
LEVEL / 03
All transitions
Valid and invalid transitions. Minimum requirement for mission and safety-critical software. Guarantees both prior levels.
Conclusion · four systematic approaches 07 / 07
Specification-based techniques

Systematic. Thorough.

— TECHNIQUE / 01
EP
— TECHNIQUE / 02
BVA
— TECHNIQUE / 03
Decision Tables
— TECHNIQUE / 04
State Transition
Together, these four black-box techniques provide a rigorous, systematic approach to testing software based solely on its specified behavior — independent of how it is implemented, and resilient to change.
.