4.1 Technique Selection and Coverage
Key Takeaways
- Test techniques help derive test conditions, test cases, and test data from a defined basis.
- Black-box, white-box, experience-based, and collaborative techniques answer different design questions.
- A coverage item is an element that must be exercised to satisfy a coverage criterion.
- Coverage is measured as exercised coverage items divided by total identified coverage items.
- Technique choice depends on risk, test level, available information, skills, time, and regulatory needs.
What Technique Selection Means
A test technique is a systematic way to identify useful tests. In CTFL v4.0.1, the major families are black-box, white-box, experience-based, and collaborative approaches.
Black-box techniques derive tests from requirements, business rules, models, user stories, interfaces, or other externally visible behavior. They do not require knowledge of internal code. Equivalence partitioning, boundary value analysis, decision table testing, and state transition testing are black-box techniques.
White-box techniques derive tests from the internal structure of a component or system. They measure how much of the code or design structure has been exercised. CTFL focuses on statement coverage and branch coverage.
Experience-based techniques rely on the tester's knowledge, defect history, domain understanding, and intuition. Exploratory testing, error guessing, and checklist-based testing are common examples. They are useful when documentation is weak or when known failure patterns deserve attention.
Collaborative approaches use shared understanding between testers, developers, business representatives, users, and other stakeholders. User story refinement, acceptance criteria review, examples, and acceptance test design help prevent defects before implementation.
Coverage Items and Coverage Measurement
A coverage item is something specific that a test must exercise to meet a coverage criterion. The item depends on the technique.
| Technique | Example coverage item |
|---|---|
| Equivalence partitioning | One valid or invalid partition |
| Boundary value analysis | A boundary value such as 18 or 19 |
| Decision table testing | A rule column in the table |
| State transition testing | A transition from one state to another |
| Statement coverage | An executable statement |
| Branch coverage | A decision outcome such as true or false |
Coverage is usually calculated as:
coverage = covered coverage items / total coverage items * 100
If a decision table has 8 rules and your tests execute 6 of those rules, rule coverage is 6 / 8 = 75 percent. If a state model has 10 transitions and tests trigger 9 transitions, transition coverage is 90 percent.
Coverage does not prove the product is defect free. It shows how thoroughly the chosen model or structure has been exercised. You can have 100 percent statement coverage and still miss a missing requirement, a wrong expected result, or an important data combination.
How to Choose a Technique
Start with the test basis. If the requirement describes input ranges, use equivalence partitioning and boundary value analysis. If it describes combinations of conditions and actions, use a decision table. If behavior depends on current state and event history, use state transition testing.
If code is available and structural risk matters, add white-box coverage. If the system is safety critical, regulated, or changed in a risky area, explicit coverage measurement becomes more valuable because it shows what was and was not exercised.
If time is short, use a risk-based blend. Cover the highest-risk partitions, boundaries, decision rules, and state transitions first. Then add experience-based testing for failure patterns not obvious from the formal model.
Worked Selection Example
Suppose a mobile banking feature lets users transfer money. Requirements say: transfers must be between $1 and $5,000, external transfers over $1,000 require step-up authentication, and locked accounts cannot transfer.
A practical design would combine techniques:
| Risk or artifact | Best technique |
|---|---|
| Dollar amount range | Equivalence partitioning and BVA |
| Step-up authentication rule | Decision table testing |
| Account lock and unlock flow | State transition testing |
| New transfer code | Statement and branch coverage |
| Past defects in currency formatting | Error guessing |
| Acceptance examples with product owner | Collaborative test design |
The important point is not to memorize labels. On the exam, ask what information is available and what kind of coverage item the question is asking you to exercise.
A requirement gives several input ranges and asks for efficient test data selection. Which technique family is the best starting point?
Which items can be coverage items, depending on the technique being used?
Select all that apply