Test Design

Test design is the test activity that turns test conditions into test cases and the other testware needed to run them. Test analysis decided what to test; test design decides how: which inputs, in which state, with which expected results, on which data and in which environment.

For example, analysis of a loyalty programme produced the condition "a member needs at least 500 points to redeem them". Test design turns it into four countable coverage items, two test cases with exact expected results, and a list of the data and environment those tests need.

Why it matters

Without test design, tests are improvised during execution: many tests of comfortable middle values, none at the edges, expected results guessed on the spot, and no way to say how much of a condition was tested. Data and environments that nobody requested in advance become blocked days.

Design done first gives you a number to report ("4 of 4 coverage items exercised") instead of a feeling, and test cases that others can review before the code exists. Writing exact expected results also exposes gaps in the test basis while they are still cheap to close.

What test design takes in and what it produces

Test design starts from the output of test analysis: prioritised test conditions, traced to the test basis. A condition such as "minimum points balance for redemption" says what to test, not yet with which values or expected results.

The ISTQB Foundation syllabus v4.0 describes test design as elaborating test conditions into test cases and other testware, often by identifying coverage items with a test technique. Its work products are:

  • Coverage items: countable items derived from each test condition, which the test cases must exercise.
  • Test cases, prioritised: preconditions, inputs, actions, expected results and postconditions.
  • Test charters, for conditions covered by exploratory testing instead of scripted test cases: a charter states what to explore and why, without fixed steps.
  • Test data requirements: which data the tests need, in which state.
  • Test environment requirements: configuration, connected systems, tools and access.

Coverage items: the bridge from condition to test case

The ISTQB glossary defines a coverage item as an attribute or combination of attributes derived from one or more test conditions by using a test technique. Put simply, the technique turns one broad condition into specific items, each needing at least one test.

This makes design measurable: coverage is the number of items exercised by at least one test case, divided by the number identified, as a percentage. It also makes depth an explicit decision: a high-risk condition gets a stronger technique and more items, a low-risk one perhaps a single test.

Each technique, taught in its own lesson in the test design techniques module, produces different items:

  • Equivalence partitioning: each partition, valid or invalid; a partition is a group of values the system should treat the same way.
  • Boundary value analysis: the boundary values, that is, the minimum and maximum of each ordered partition. In 2-value BVA each boundary value is paired with its closest neighbour in the adjacent partition, so a limit at 500 points gives 499 and 500.
  • Decision table testing: each feasible column, that is, a combination of conditions.
  • State transition testing: states, valid transitions or all transitions, depending on the coverage criterion.

Try it: Equivalence Partition Generator Try it: Boundary Value Analysis

Worked example: one condition, four coverage items, two test cases

Test basis, story LOY-9 of a grocery app: "Members with at least 500 points can redeem them at checkout. Every 100 points take 10.00 SAR off the order. Points expire 12 months after they are earned." Analysis rated TCO-1, the minimum balance, high risk: a defect here gives away discounts or blocks entitled members.

Equivalence partitioning and 2-value boundary value analysis give four coverage items. Two test cases exercise all of them, because each test case hits one partition and one boundary value at the same time. The lower partition starts at 0, the smallest possible balance, so 0 is a boundary value too; analysis gave members with no points a condition of their own, so this design keeps to the 500 threshold.

Test design for the points rule: one condition, two techniques, four coverage items, two test cases that exercise all four, and the data and environment those tests need.
  1. 1Test conditionInput from test analysis: what to testTCO-1 Minimum balance to redeem points · risk: high
  2. 2Test techniquesEquivalence partitioning and 2-value boundary value analysis, chosen for the risk
  3. 34 coverage itemsPartitions: below 500, 500 or more · boundary values: 499, 500
  4. 42 test cases4 of 4 coverage items exercised: 100%TC-11: 499 points, cannot redeem · TC-12: 500 points, 50.00 SAR off
    designed alongside
    • 5Data and environment requirementsMembers with exactly 499 and 500 points; the loyalty service or a stub

Throughout steps 2–4 Test design: how to test

Then:Test implementation then creates the data, prepares the environment and assembles the test procedures

  • Test data requirements: members with exactly 499 and exactly 500 points, all earned in the last 12 months so that expiry cannot interfere, and a cart totalling 120.00 SAR.
  • Test environment requirements: the loyalty service connected, or a stub that returns a given balance, and a way to set balances, such as an admin screen or a seed script.
  • Questions the design raised: below 500, is the redeem option hidden or disabled, and with which message? Can a member redeem 550 points, or only multiples of 100? What if the discount exceeds the order total?
Condition   TCO-1  Minimum balance to redeem points   (risk: high)
Techniques  equivalence partitioning + 2-value boundary value analysis

Coverage item                          Exercised by
CI-1  partition: balance below 500     TC-11
CI-2  partition: balance 500 or more   TC-12
CI-3  boundary value 499               TC-11
CI-4  boundary value 500               TC-12

TC-11  Member with 499 points, order total 120.00, opens payment
       Expected: points cannot be redeemed, total stays 120.00
TC-12  Member with 500 points redeems 500 points, order total 120.00
       Expected: 50.00 SAR off, total 70.00, 500 points deducted

Coverage: 4 of 4 coverage items = 100%

Try it: Requirements → Test Cases Try it: Test Case Generator

Design the data and the environment; build them later

Test design specifies what the tests need; test implementation, the next activity, creates it. Writing the needs down now gets data and environments ready in time, instead of blocked tests on the first day of execution.

A test data requirement describes records and their states ("a member with exactly 499 points, all earned in the last 12 months"), not a user id. A test environment requirement covers connections and configuration: third-party sandboxes or stubs, feature flags, language and time zone, an account for each role, and controls such as setting the date.

ISO/IEC/IEEE 29119-2 describes one combined test design and implementation process. Its 2021 edition derives the test coverage items from a test model, such as a set of partitions or a state diagram, instead of from test conditions, then derives test cases and test procedures. ISTQB keeps the two activities apart; many teams do both in one sitting.

Try it: Test Data Factory

Common mistakes

  • Going from the requirement straight to test cases with no coverage items, so nobody can tell whether the set is complete.
  • Many test cases for the same coverage item, such as five balances between 600 and 2,000 points, while 499 and 500 have no test.
  • Vague expected results such as "discount applied correctly" instead of values from the test basis: 50.00 SAR off, total 70.00.
  • Leaving data and environment needs implicit until execution reveals that no member has exactly 499 points.
  • Test cases without the id of their test condition, so a requirement change cannot be traced to the tests it affects.
  • The same depth for every condition, instead of spending the most coverage items where a failure would cost the most.

The QA perspective

On an agile team, test design happens story by story, during refinement and early in the sprint, once the acceptance criteria are stable. The tester settles expected results and open questions with the product owner, technical limits and ways to set data or the clock with developers, and asks another tester to review the design.

Record, for each test condition, the technique, the coverage items and the test cases that exercise them, with the condition id on every test case so traceability survives requirement changes. Hand the data and environment requirements to whoever prepares them and give each open question an owner. Test implementation starts from this record.

Practice exercise

Design tests for clinic appointment rules

Your task

This exercise continues the clinic story US-57 from the lesson on test analysis. The product owner has answered the questions on AC2 and AC5 with the two rules below; because a late cancellation now costs the patient money, condition C7 was re-rated from medium to high risk. Identify the coverage items of C3 and C7, write the smallest set of test cases that exercises all of them, and list what those tests need.

Count the booking window in whole days and compare times to the minute. Write every other assumption down as a question.

Material
Story US-57  Book a clinic appointment online
The product owner's answers to the questions on AC2 and AC5:
Rule 1  A patient can book an appointment 1 to 30 days ahead of today.
Rule 2  Cancelling is free up to 24 hours before the appointment;
        a later cancellation costs a 50.00 SAR fee.

Test conditions from test analysis
C3  Booking window: how many days ahead a patient can book      (risk: medium)
C7  Cancellation fee depends on the time left before the start  (risk: high)
Steps
  1. For C3, list the partitions of "days ahead" and the 2-value boundary values.
  2. Do the same for C7 with "time left before the appointment".
  3. Write the minimum test cases with input, expected result and the coverage items each one exercises; calculate the coverage.
  4. List the data and environment requirements and the questions for the product owner.
Show the model answer
Model answer

C3, seven coverage items. Partitions: 0 days ahead or fewer, meaning today or a past date (invalid, CI-1); 1 to 30 days (valid, CI-2); 31 or more (invalid, CI-3). Boundary values: 0, 1, 30 and 31 (CI-4 to CI-7). Four test cases: today, refused (CI-1, CI-4); tomorrow, booked (CI-2, CI-5); 30 days ahead, booked (CI-2, CI-6); 31 days ahead, refused (CI-3, CI-7). Coverage: 7 of 7 = 100%.

C7, four coverage items. Partitions: 24 hours or more before the start, free (CI-8); less than 24 hours, fee (CI-9). Boundary values: 24:00 and 23:59 before the start (CI-10, CI-11). Two test cases, both high priority: cancel exactly 24 hours before, no fee (CI-8, CI-10); cancel 23 hours 59 minutes before, a 50.00 SAR fee is charged (CI-9, CI-11). Coverage: 4 of 4 = 100%. The other edge of the fee partition, the start time itself, depends on the answer to the last question below.

Data: a patient with a payment method in the payment sandbox; a doctor with free slots today, tomorrow, and 30 and 31 days ahead (without a slot on day 31, a refusal proves nothing); appointments with known start times. Environment: the production time zone, a controllable clock or another way to hit the 24-hour boundary to the minute, and the payment sandbox connected.

Questions: Is cancelling at exactly 24 hours free? Minute or second precision? Whose time zone? Is today day 0? Can a patient cancel after the start, and at what cost?

Frequently asked questions

What is the difference between test analysis and test design?

Test analysis answers "what to test": it evaluates the test basis and produces prioritised test conditions. Test design answers "how to test": it turns those conditions into coverage items, test cases, and data and environment requirements. On small teams one person often does both in one sitting, but keeping the two questions apart helps you notice when one of them was skipped.

Is a coverage item the same as a test case?

No. A coverage item is something that must be exercised; a test case is what exercises it. One test case can cover several items: in the worked example, the test case with 500 points exercises both the "500 or more" partition and the boundary value 500. Coverage counts items, so adding test cases that hit the same items does not raise it.

Do I always need detailed, step-by-step test cases?

No. The level of detail follows the context agreed in the test plan. Regulated work, automation and new team members need low-level test cases with concrete values; an experienced team may keep high-level test cases, or cover a condition with an exploratory test charter, which the ISTQB syllabus also lists as a test design work product.

Does 100% coverage mean the feature has no defects?

No. It means every coverage item you identified was exercised by at least one test. Defects can still hide in conditions that analysis missed, in items the chosen technique does not produce, or in combinations nobody designed. Coverage shows what was tested, not that the software is correct.

References

Practise with Mutqan tools

Convert a list of numbered requirements into traceable test cases with a requirement-to-test matrix.

Test Design

Perform full boundary value analysis (2-value and 3-value BVA) with equivalence classes and expected results.

Test Design

Generate structured test cases (id, title, preconditions, steps, expected result, priority) from a feature description and field list.

Test Design

One-stop factory for synthetic test data: users, customers, companies, addresses, numbers, dates and strings in JSON, CSV, SQL or XML.

Test Data

Go deeper

Your progress on this topic

Part of the QA Roadmap