Test Analysis And Design
Test Analysis and Design
Chapter 4 interactive study guide covering test-technique selection, black-box, white-box and experience-based techniques, plus collaboration-based test approaches.
Test Analysis and Design
Test techniques provide systematic ways to derive test conditions, test cases and test data. Chapter 4 groups the core techniques by the source of knowledge used about the test object.
4.1 Overview → choose and distinguish techniques. 4.2 Black-box → EP, BVA, decision tables, state transitions. 4.3 White-box → statement and branch testing. 4.4 Experience-based → error guessing, exploratory, checklist-based. 4.5 Collaboration-based → user stories, acceptance criteria and ATDD.
Test Techniques Overview
The Foundation Level material distinguishes three main categories according to the source used to derive tests.
| Category | Primary source | Typical focus |
|---|---|---|
| Black-box | Requirements, specifications, use cases, user stories | Discrepancies between specified and implemented behavior |
| White-box | Internal structure such as code, architecture or detailed design | Control-flow and structural problems |
| Experience-based | Knowledge, experience and intuition of stakeholders | Problems suggested by experience, risks and known failure modes |
Four black-box + two white-box + three experience-based techniques form the main Foundation Level technique set.
Black-Box Test Techniques
Black-box techniques derive tests from externally visible behavior and specifications without depending on the internal implementation.
Equivalence Partitioning
Divide a domain into equivalence partitions whose members are expected to be processed in the same way, then test representative values.
Valid partitions
Contain values accepted by the specification. One representative can exercise a partition.
Invalid partitions
Contain values that violate the specification. Invalid partitions should also be considered where applicable.
Coverage
Number of partitions exercised by at least one test value divided by the total identified partitions.
In multidimensional problems, combining several invalid conditions in one test may cause defect masking. Treat the selected domain and partition model carefully.
Boundary Value Analysis
BVA extends equivalence partitioning by concentrating tests on the edges of ordered partitions, where implementation errors are common.
Example boundary: x ≤ 10
2-value BVA focuses on boundary values; 3-value BVA also includes neighboring values and can detect some defects that 2-value BVA misses.
BVA requires an ordered domain and contiguous partitions so that smallest/largest elements and their neighbors are meaningful.
Decision Table Testing
Decision tables systematically test business rules involving combinations of conditions and resulting actions.
| Rule | C1 | C2 | Action |
|---|---|---|---|
| R1 | T | T | A |
| R2 | T | F | B |
| R3 | F | T | C |
| R4 | F | F | D |
Identify conditions → identify actions → generate feasible condition combinations → determine actions for each rule → derive test cases from the rules.
State Transition Testing
Use a state model when system behavior depends on its current state and an event can cause a transition, action or invalid transition.
State coverage
Exercise identified states.
Valid-transition coverage
Exercise valid transitions represented by the model.
Invalid transitions
Check events that should not cause a valid transition from a given state.
White-Box Test Techniques
White-box testing derives coverage items from the internal structure of the test object, commonly represented by code or a control-flow graph.
Statement Testing and Coverage
Statement testing designs tests to execute executable statements.
Statement coverage = executed statements ÷ total executable statements × 100%
Branch Testing and Coverage
Branch testing exercises branches in the control flow, including conditional and unconditional branches.
Branch coverage = exercised branches ÷ total branches × 100%
Value of White-Box Testing
Structural coverage provides an objective measure of how much of the implementation has been exercised and can reveal untested structural elements.
Achieving 100% branch coverage implies 100% statement coverage, but 100% statement coverage does not necessarily imply 100% branch coverage.
Experience-Based Test Techniques
These techniques make deliberate use of tester knowledge, experience and intuition and often complement black-box and white-box techniques.
4.4.1 Error Guessing
Derive tests from likely errors, past failures, known weaknesses and common failure modes. A defect/attack list can support the technique.
4.4.2 Exploratory Testing
Design, execute, evaluate and learn dynamically. Session-based testing can use a charter, timebox, notes and a debrief.
4.4.3 Checklist-Based Testing
Design and execute tests to cover items on a checklist derived from experience, risks, standards or known defect types.
Collaboration-Based Test Approaches
Collaboration among business representatives, developers and testers helps prevent defects by building shared understanding before implementation.
Collaborative User Story Writing
User stories communicate value and stimulate conversation. Collaborative writing helps stakeholders clarify needs and testability.
As a <role>, I want <goal>, so that <business value>. Stories are refined through conversation and supported by acceptance criteria.
Acceptance Criteria
Acceptance criteria define conditions that a component or system must satisfy to be accepted and provide a basis for acceptance tests.
Scenario-oriented
Concrete examples, often expressed using Given / When / Then.
Rule-oriented
Rules, constraints or bullet-point conditions describing acceptable behavior.
Acceptance Test-Driven Development
ATDD is a collaborative, test-first approach in which acceptance tests are defined before implementation using language meaningful to stakeholders.
Interactive Technique Guide
Choose any of the nine CTFL test techniques. Each guide gives you an exam-style example, lets you think through the problem, and then reveals a suggested solution with the reasoning and coverage calculation where applicable.
Key Takeaways
Choose by information source
Specification → black-box; structure → white-box; experience → experience-based.
EP before BVA
BVA builds on partitions and concentrates on boundaries and, for 3-value BVA, neighboring values.
Rules vs states
Decision tables suit combinations of conditions; state transitions suit behavior dependent on history/current state.
Coverage matters
Coverage measures how thoroughly specified coverage items have been exercised.
Experience complements
Error guessing, exploratory and checklist-based testing add insights formal models may miss.
Collaborate early
User stories, acceptance criteria and ATDD build shared understanding and support defect prevention.
Knowledge Check
20 questions covering the major Chapter 4 concepts. Select one answer per question, then check your answers to see an explanation for every option.