ISTQB CTFL Black-box Test Techniques: Equivalence Partitioning, Boundary Value Analysis, Decision Tables and State Transitions
Black-box test techniques are specification-based techniques that derive test cases from the required behaviour of a test object without reference to its internal structure. This CTFL lesson shows how to apply the four techniques in the syllabus: equivalence partitioning (including Each Choice coverage), 2-value and 3-value boundary value analysis, decision table testing with table minimization, and state transition testing with its three coverage criteria, and how to calculate the coverage items, minimum test cases and coverage percentages the exam asks for.
On this page10 sections
- What are black-box test techniques for?
- How does equivalence partitioning work?
- What is Each Choice coverage?
- How does boundary value analysis work?
- 2-value vs 3-value boundary value analysis
- How does decision table testing work?
- Decision table coverage and minimizing the table
- How does state transition testing work?
- State transition coverage criteria
- Deriving the minimum test cases from a state model
- Use equivalence partitioning to identify valid and invalid partitions for any data element and derive the minimum test values for full coverage
- Calculate equivalence partition coverage and the minimum test cases for Each Choice coverage
- Use 2-value and 3-value boundary value analysis to derive coverage items and calculate boundary value coverage
- Build, read and minimize limited-entry and extended-entry decision tables and derive test cases for decision table coverage
- Read state diagrams and state tables and derive test cases for all states, valid transitions and all transitions coverage
- Explain the strengths and weaknesses of each technique and the subsumption between state transition coverage criteria
What are black-box test techniques for?
Black-box test techniques derive test conditions, test cases and test data from the specified behaviour of the test object, without looking at its internal structure. The CTFL syllabus covers four of them, and each one models the requirements in a different way, so each finds a different kind of defect:
| Technique | What it models | Coverage items | Best at finding |
|---|---|---|---|
| Equivalence partitioning (EP) | Groups of values the test object should process the same way | Partitions (valid and invalid) | A whole class of values handled wrongly |
| Boundary value analysis (BVA) | The edges of ordered partitions | Boundary values and their neighbours | Misplaced or wrongly coded boundaries (off-by-one, < instead of <=) |
| Decision table testing | How combinations of conditions lead to actions | Columns (rules) with feasible combinations | Missing, wrong or contradictory business rules |
| State transition testing | States, events and the transitions between them | States, valid transitions or all transitions | Wrong behaviour in a sequence of events, and events accepted when they must be rejected |
All four are K3 objectives: you are expected to apply them to a short specification and work out coverage items, a minimum number of test cases or a coverage percentage. Coverage is always calculated the same way: coverage items exercised divided by coverage items identified, as a percentage. How black-box techniques differ from white-box and experience-based techniques is covered in the test techniques overview lesson.
How does equivalence partitioning work?
Equivalence partitioning divides data into partitions (equivalence classes) based on the expectation that all elements of a partition are processed the same way by the test object. If a test with one value from a partition detects a defect, tests with other values from that partition should detect it too, so one value represents the whole partition.
Rules for partitions
- Partitions can be identified for any data element related to the test object: inputs, outputs, configuration items, internal values, time-related values and interface parameters, not only input fields.
- A partition can be continuous or discrete, ordered or unordered, finite or infinite. A whole-number range is ordered; a list of payment methods or countries is unordered.
- Partitions must not overlap and must be non-empty sets: every value belongs to exactly one partition, and a partition with a single value is still a partition.
- A valid partition contains values the test object should process according to its specification; an invalid partition contains values it should ignore or reject. Exactly what counts as valid or invalid can vary between teams and organizations: valid may mean values the specification defines processing for, and invalid values for which no processing is defined. Either way, state the interpretation you use and apply it consistently.
Identifying the partitions
Read the specification and split the whole domain, including what is rejected. A field that accepts whole numbers 100 to 999 has three partitions: below 100 (invalid), 100 to 999 (valid) and above 999 (invalid). If the specification also defines a separate response for entries that are not whole numbers (text or decimals), that is one more, unordered invalid partition. If valid values are processed differently (for example 1 to 9 items shipped at the normal rate and 10 to 99 items with a bulk discount), each processing rule is its own valid partition.
Minimum tests and coverage
The coverage items are the partitions. 100% equivalence partition coverage requires test cases that exercise every identified partition, valid and invalid, at least once, so the minimum number of test values for a single input equals its number of partitions. Coverage is partitions exercised divided by partitions identified. Two test values in the same partition count once, and a value that merely looks like a boundary covers only the one partition it falls in. Always include the invalid partitions in both the numerator and the denominator.
What is Each Choice coverage?
Each Choice coverage is the simplest coverage criterion for a test object with several sets of partitions, for example one set per input or configuration parameter. It is achieved when each partition from each set is exercised by at least one test case; combinations of partitions are not taken into account.
Because one test case picks one partition from every set at the same time, a single test can cover a partition of each input. The minimum number of test cases is therefore the size of the largest set: shorter sets simply repeat a value. For three inputs with 2, 5 and 3 partitions, five tests are enough. Adding the counts ignores this sharing, and multiplying them would test every combination, which is a much stronger and more expensive goal.
When some tests already exist, list which partitions of each set are still missing. Each additional test can take one missing partition from every set, so the number of additional tests needed is the largest number of missing partitions in any one set. Duplicate existing tests add nothing.
How does boundary value analysis work?
Boundary value analysis (BVA) exercises the boundaries of equivalence partitions. It can only be used for ordered partitions: the minimum and maximum values of a partition are its boundary values, and an unordered category (seat class, country, payment method) has no smallest or largest value. A partition is ordered when its values have a natural order, so it has a smallest and a largest value.
BVA focuses on boundaries because developers are more likely to make mistakes there: a boundary may be misplaced in the specification or coded wrongly, such as < instead of <=. Every partition next to a boundary contributes a boundary value, including the invalid ones: for a valid range 200 to 500 of whole numbers, the boundary values are 199 (maximum of the lower invalid partition), 200, 500 and 501 (minimum of the upper invalid partition).
Neighbours depend on precision
The closest neighbour is one step away in the precision the specification uses. For whole numbers the step is 1; for amounts entered with two decimal places it is 0.01, so a valid range 1.50 to 25.00 has outside neighbours 1.49 and 25.01, not 1 and 26 counted in whole units.
2-value vs 3-value boundary value analysis
2-value BVA tests each boundary value with its closest neighbour in the adjacent partition, while 3-value BVA tests each boundary value with both of its neighbours. The two CTFL variants differ only in the coverage items each boundary value produces:
| Variant | Coverage items for each boundary value | Example: whole numbers 30 to 60 valid |
|---|---|---|
| 2-value BVA | The boundary value and its closest neighbour that belongs to the adjacent partition | 29, 30, 60, 61 |
| 3-value BVA | The boundary value and both of its neighbours | 29, 30, 31 and 59, 60, 61 |
In 3-value BVA a neighbour may sit in the same partition as the boundary value. The 2-value set is always contained in the 3-value set. Values two or more steps away from a boundary are not coverage items in either variant.
Why 3-value BVA is more rigorous
3-value BVA can detect defects that 2-value BVA misses. Suppose the requirement is x <= 10 but the code says x == 10. 2-value BVA tests 10 and 11: 10 behaves correctly under both conditions and 11 is correctly rejected, so both tests pass. 3-value BVA also tests 9, where the requirement says yes and the faulty code says no, so the defect is found. The extra neighbour inside the partition catches conditions that are only correct exactly at the boundary.
BVA coverage
BVA coverage is boundary values (coverage items) exercised divided by the total identified, for the variant being used. A test value inside an invalid partition that is not one of its boundary values or neighbours (say 3 when the range starts at 5) counts for EP but adds nothing to BVA coverage. Pass rates are results, not coverage.
Combining EP and BVA
A well-chosen BVA set also exercises every ordered partition, because each boundary value belongs to one. To reach both 100% EP and 100% 2-value BVA coverage, count the distinct boundary values (two per internal boundary) and then add one test value for each partition that has no boundaries, such as an unordered "not a number" partition. Open-ended outer partitions (below the minimum, above the maximum) still have one boundary value each, the one next to the valid range.
How does decision table testing work?
Decision table testing checks how the test object implements requirements in which different combinations of conditions result in different outcomes. It is an effective way to record complex logic such as business rules.
In a decision table, the conditions and the resulting actions of the system are rows, and each column is a decision rule: one unique combination of conditions together with the actions it triggers.
Notation
| Entry | Meaning |
|---|---|
| T / F | The condition is true / false (limited-entry tables) |
| – (dash) | The value of the condition is irrelevant to the outcome for that rule |
| N/A | The condition is infeasible for that rule |
| X | The action occurs |
| Blank action cell | The action does not occur |
In a limited-entry table, conditions are true or false and actions are X or blank. In an extended-entry table, conditions and actions can take multiple values, such as ranges of numbers, equivalence partitions or discrete values. Dashes and infeasible combinations can occur in either kind.
To read a table for a given case, find the column whose condition values match; a dash matches any value. Then read its action cells: every X happens, every blank does not.
Decision table coverage and minimizing the table
The coverage items are the columns containing feasible combinations of conditions, and 100% decision table coverage needs test cases that exercise all of them; infeasible combinations cannot be tested and are not coverage items. For a limited-entry table, the full table has one column per combination of condition values: with n Boolean conditions, 2 to the power n columns (2 conditions give 4, 5 give 32).
So the minimum number of test cases is the full column count minus the infeasible columns: with 32 columns of which 6 are infeasible, at least 26 test cases are needed. Covering each condition true and false once, or triggering each action once, is a weaker goal and can leave combinations untested.
Minimizing
The table can be simplified by deleting infeasible columns and merging columns in which some conditions do not affect the outcome into a single column, where those conditions get a dash. Work rule by rule: if one condition decides the outcome on its own (for example an expired membership blocks entry whatever else is true), all the columns sharing that value merge into one; columns where another condition still changes the action must stay separate. The minimized columns are then the coverage items.
Strengths and weaknesses
- Strength: a systematic approach to identify all combinations of conditions, some of which might otherwise be overlooked, and it helps to find gaps or contradictions in the requirements.
- Weakness: with many conditions, exercising all decision rules is time-consuming, because the number of rules grows exponentially with the number of conditions. To keep it manageable, use a minimized decision table or a risk-based approach to choose which rules to test.
A decision table answers "which combination leads to which action". Event sequences belong to state transition testing, and one value per group of equally processed values belongs to equivalence partitioning.
How does state transition testing work?
State transition testing models the behaviour of a system as a set of states and the transitions between them. A state diagram shows the possible states and the valid transitions. A transition is initiated by an event, may be qualified by a guard condition, is assumed to be instantaneous and may result in the software taking an action.
The common labelling syntax is event [guard condition] / action. In submit [formComplete] / sendConfirmation, submit is the event, formComplete is the guard that must hold for the transition to fire, and sendConfirmation is the action. Guard conditions and actions can be omitted when they do not exist or are irrelevant. The target state is shown by the arrow, not in the label.
State table
A state table is an equivalent model: rows represent states, columns represent events (together with guard conditions if they exist), and each filled cell represents a transition, holding the target state and the resulting action if one is defined. Unlike the diagram, the state table shows invalid transitions explicitly, as empty cells, which is why it is the natural source for all transitions coverage. A valid transition with no action, or a transition back into the same state, still names a target state in its cell.
A test case is usually a sequence of events that produces a sequence of state changes (and actions where needed). One test case can, and usually will, cover several transitions.
State transition coverage criteria
The CTFL syllabus defines three coverage criteria for state transition testing:
| Criterion | Coverage items | Notes |
|---|---|---|
| All states coverage | The states | Weakest; can usually be achieved without exercising all transitions |
| Valid transitions coverage (0-switch coverage) | Single valid transitions | The most widely used criterion; 100% guarantees 100% all states coverage |
| All transitions coverage | All transitions in the state table: every valid one exercised, every invalid one attempted | 100% guarantees both other criteria; should be a minimum requirement for mission- and safety-critical software |
The subsumption runs one way only. Every valid transition ends in a state, so exercising all of them visits every state, but visiting every state does not exercise every transition when a state can be entered in several ways. Valid transitions coverage alone never attempts an invalid transition, so it cannot guarantee all transitions coverage.
Calculating coverage
For all transitions coverage, every cell of the state table is a coverage item: with 5 states and 2 events there are 10 cells. If 6 are valid and 4 invalid, exercising all 6 valid transitions and attempting 1 invalid one covers 7 of 10 items, 70%, while the same tests give 100% valid transitions coverage.
One invalid transition per test case
When testing invalid transitions, attempt only one invalid transition in each test case. This avoids defect masking (also called fault masking), where one defect hides another: if the first invalid event is handled wrongly, the system may end in an unexpected state, and later checks in the same test pass or fail for the wrong reason. Valid transitions are still used to reach the state from which the invalid event is attempted.
Deriving the minimum test cases from a state model
To find the minimum number of test cases for a criterion, trace event sequences from the initial state and use the structure of the model:
- List the coverage items for the criterion: states, valid transitions, or all cells of the state table.
- Count the endings. If every test starts in the initial state and stops when it reaches a final state, one test can only take one transition into a final state. The number of different transitions into final states (for valid transitions coverage), or of different final states (for all states coverage), is a lower bound.
- Use loops. Transitions that lead back to an earlier state (such as retry or edit loops) let one test exercise many transitions before it ends, so the lower bound is often enough.
- Write the sequences and check that together they cover every item.
For example, a model with three different transitions into final states needs at least three tests for valid transitions coverage, and three are enough if loops let the earlier tests pick up every other transition before they end. Without such loops, a transition that can only be reached on a path that bypasses another one forces an extra test. For all states coverage, the bound comes from the final states that cannot be reached together in one test.
Tip. Questions on this topic are mostly K3 worked problems with an exact numeric or set answer, plus some K1 and K2 items on definitions and notation, often with an uppercase qualifier such as MINIMUM, CORRECT or BEST. Expect to identify the partitions in a short specification, pick a set of test values that achieves full partition coverage, and calculate equivalence partition or Each Choice coverage, including how many additional tests an existing set needs. For boundary value analysis, expect to list the 2-value or 3-value coverage items (including decimal precision), decide whether BVA applies to a partition, calculate BVA coverage, combine EP and BVA into a minimum test count, and reason about which variant would detect a described coding defect. For decision tables, expect to read a small table given as text, interpret dashes, N/A, X and blank cells, count full-table and feasible columns, minimize a table from a business rule and recognise the technique's strength and weakness. For state transition testing, expect to read event [guard] / action labels and state tables, calculate coverage for the three criteria, compare their strength, explain the one-invalid-transition rule, and derive the minimum number of test cases from a state model described in words.
- Equivalence partitions must not overlap and must be non-empty; they can be identified for any data element (inputs, outputs, configuration, internal and time-related values) and can be ordered or unordered.
- A valid partition holds values the test object should process and an invalid partition values it should ignore or reject (definitions can vary between teams); 100% EP coverage needs every partition, valid and invalid, exercised at least once.
- Each Choice coverage needs each partition of each set exercised once, without combinations, so the minimum test count is the size of the largest set.
- BVA applies only to ordered partitions; a partition's minimum and maximum are its boundary values, and neighbours are one step away in the specified precision.
- 2-value BVA tests each boundary value and its closest neighbour in the adjacent partition; 3-value BVA tests both neighbours and can catch defects 2-value misses.
- In a decision table each column is a rule; a dash means irrelevant, N/A means infeasible, X means the action occurs and a blank means it does not.
- Decision table coverage items are the feasible columns; the table grows exponentially, so minimize it (drop infeasible, merge irrelevant) or select rules by risk.
- State transition labels read event [guard] / action; a state table shows invalid transitions as empty cells.
- Valid transitions (0-switch) coverage subsumes all states coverage; all transitions coverage subsumes both and is the minimum for mission- and safety-critical software.
- Attempt only one invalid transition per test case to avoid defect masking.
Frequently asked questions
What is the difference between 2-value and 3-value boundary value analysis?
In 2-value boundary value analysis, each boundary value is tested together with its closest neighbour in the adjacent partition, so a valid range of 30 to 60 gives 29, 30, 60 and 61. In 3-value boundary value analysis, each boundary value is tested with both of its neighbours, giving 29, 30, 31, 59, 60 and 61. The 3-value variant is more rigorous because the extra neighbour inside the partition can reveal a condition that is only correct exactly at the boundary.
Do invalid partitions count towards equivalence partition coverage?
Yes. Every identified partition is a coverage item in equivalence partitioning, including invalid partitions that the specification says should be rejected or ignored. Equivalence partition coverage is the number of partitions exercised divided by the total number identified, valid and invalid, so leaving out the invalid partitions inflates the result.
How do you calculate the minimum number of tests for Each Choice coverage?
Each Choice coverage requires every partition of every set to be exercised by at least one test case, without testing combinations. Because one test case uses one partition from each set at the same time, the minimum number of test cases equals the number of partitions in the largest set. If some tests already exist, the additional tests needed equal the largest number of still-uncovered partitions in any one set.
Can boundary value analysis be used for every input?
No. Boundary value analysis can only be applied to ordered partitions, because boundary values are the minimum and maximum values of a partition. Unordered categories such as countries, payment methods or seat classes can be divided into equivalence partitions but have no boundaries to test.
What are the coverage items in decision table testing?
The coverage items in decision table testing are the columns of the table that contain feasible combinations of conditions. Full decision table coverage requires test cases that exercise every such column. Infeasible combinations, marked N/A, are not coverage items, and a minimized table has fewer columns because rules whose differing conditions do not affect the outcome are merged.
What do a dash and N/A mean in a decision table?
In a decision table, a dash means the value of that condition is irrelevant to the outcome of the rule, so the rule applies whatever the condition's value is. N/A means the condition is infeasible for that rule. In the action rows, an X means the action occurs and a blank cell means it does not.
What is the difference between valid transitions coverage and all transitions coverage?
Valid transitions coverage, also called 0-switch coverage, requires every valid transition in the state model to be exercised. All transitions coverage requires every transition in the state table to be covered: all valid transitions exercised and all invalid transitions attempted. Full all transitions coverage guarantees full valid transitions and all states coverage, and it should be a minimum requirement for mission-critical and safety-critical software.
Why should a state transition test case attempt only one invalid transition?
Attempting only one invalid transition per test case avoids defect masking, where one defect hides another. If a test tries several invalid events and the first is handled wrongly, the system can end up in an unexpected state, so the later checks in the same test no longer show whether the other invalid events are rejected correctly.
Source
This lesson covers the "Test Analysis and Design" domain of the official CTFL exam guide. Vendors revise their guides — check the source for the current version.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.