Your Training Partner
Techniques Toolbox
Diagram from left to right on rule LIV-03, which makes shipping free for orders of CHF 100.00 or more. The acceptance criterion yields the test condition "basket below the threshold". The condition yields the high-level test case HL-02. The analyst refines it into the low-level test case LL-03. This case opens into four compartments. Preconditions: customer C-017 logged in; address 1004 Lausanne; basket empty. Inputs and actions: item A-099 at CHF 99.95; confirm the order. Expected result: shipping fee CHF 8.50; total CHF 108.45. Postconditions: order of CHF 108.45 recorded; basket empty. Next come the test procedure and the test script, the test suite, then the test result. A return arrow links the result back to the acceptance criterion: traceability.

Test Cases and Test Scripts

A test case describes a check: the preconditions, the inputs, the actions, the expected result and the postconditions. The tester runs it and compares the actual result with the expected result. A test script is a sequence of instructions for running a test. A tester follows it by hand or a tool runs it. Both definitions come from the glossary of the ISTQB, which certifies software testers. In acceptance testing, the business analyst derives the cases from the acceptance criteria together with the tester.

Goal

Before execution, a test case states how to verify a test condition: the state the system starts in, what the tester enters and what the tester must observe. A test condition is a testable aspect of the system. Test analysis derives it from a requirement or an acceptance criterion. In acceptance testing, the acceptance decision rests on the verdicts of the cases.

A requirement states what the system must do. It does not state which data will verify it. The SWEBOK adds that input values are not always enough: the system can react differently to the same input depending on its state or its environment. So the case also fixes that state. Another tester reruns a low-level case and gets the same verdict.

The technique produces test cases, the procedures that order them and the scripts that run them. In a HERMES project, the test concept describes each test case in detail. This description is the test specification. The test report lists each case with its ID, its designation, the test date, the tester and the defect found. This report is reviewed before the preliminary acceptance decision.

Usage

When to use it

  • User acceptance testing (UAT) in preparation: derive the users' test cases from the acceptance criteria.
  • Acceptance criteria being elicited: write the first cases with the tester to spot vague criteria.
  • User story in backlog refinement: write the acceptance cases before development.
  • HERMES project in the Concept phase: describe the test cases in the test concept.
  • Evidence required by an audit or a contract: write low-level cases that a third party reruns with the same steps and gets the same result.
  • External or novice testers: give them low-level cases with all the data and actions.
  • Regression testing at every release: turn stable cases into automated scripts.
  • Test team spread over several sites: the written case replaces the analyst's verbal explanation.
  • Solution tested by a supplier: review the supplier's procedures and scripts against the acceptance criteria.

When not to use it

  • Acceptance criteria missing or vague: the case would invent the rule; write the acceptance and evaluation criteria first.
  • Test strategy still open (method, test levels, schedule): settle it first in test and inspection planning.
  • Sparse specifications or a tight test deadline: run exploratory testing in time-boxed sessions.

Description

From test condition to test script

The documents from which the team derives its tests form the test basis: requirements, acceptance criteria, models. Test analysis extracts the test conditions from it. According to the ISTQB Foundation syllabus, analysis answers "what to test?". Design answers "how to test?": it turns each condition into a test case.

Implementation groups the cases into test procedures. A procedure is a sequence of cases in their execution order. The team then assembles the procedures or scripts of one test run into a test suite.

The case sets the inputs and the expected result. The test script gives the instructions to follow and their order. The ISTQB uses this term for two forms: a tester follows a manual script, a tool runs an automated script. Both forms start from the same test cases.

Traceability links the test basis, the conditions, the cases, the results and the defects. A requirements traceability matrix shows which criterion has no case yet.

The elements of a test case

Objective and trace. The title of the case names the test condition it covers. An identifier links it to the requirement or criterion it comes from.

Preconditions. The ISTQB glossary defines them as the required state of the test object and its environment before execution: a customer logged in, an empty basket.

Inputs and actions. The tester enters data and performs actions. The glossary adds "where applicable" to the actions: some cases come down to an input and the system's response.

Expected result. The glossary defines it as the observable behaviour that the test basis predicts under specified conditions. The case records it before execution as a value: "shipping fee: CHF 8.50".

Postconditions. The glossary defines them as the expected state of the test object and its environment at the end of execution: the order recorded, the stock down by one unit.

The oracle behind the expected result

A test oracle is the source that determines the expected result. According to the ISTQB Test Analyst syllabus, the test basis should provide it: a specification, a business rule, a decision table. Failing that, the oracle is the experience of a person who knows the domain. An automated oracle takes over when a tool generates inputs in bulk. When no cost-effective oracle exists, the syllabus calls the situation the test oracle problem. Missing or ambiguous requirements are a typical cause.

The tester who copies the actual result into the expected-result column removes the oracle. The case then passes by construction. The analyst puts the question to the owner of the rule instead of guessing the answer.

High level or low level

A high-level test case (abstract, logical) states the test conditions it covers without concrete values: "order at or above the threshold; expected result: free shipping". A low-level test case (concrete, physical) refines it with specific preconditions, data, expected results and postconditions. One high-level case yields one or more low-level cases.

The Test Analyst syllabus points out that this step does more than fill in values: it moves the case from the conceptual to the technical level. The team often defers it to implementation, especially when the case needs specific test data. Many cases are hybrid: concrete in some respects, abstract in others.

High levelLow level
ContentTest conditions covered; abstract preconditions, inputs and resultsConcrete preconditions, data, actions, expected result and postconditions
WrittenEarly, from requirements analysis onWhen the test basis is defined and stable
StrengthsReusable with other data; covers risks better because the tester varies the data on each runExecutable by a novice tester; reproducible result; verifiable by an audit; faster automation; reveals hard-to-see defects in the test basis
LimitsHard to reproduce; needs an experienced tester; automation may check the wrong resultCostly to write and maintain; curbs the tester's initiative; needs a well-defined test basis
The table compares high-level and low-level test cases by their content, the time they are written, their strengths and their limits.

The team chooses the level area by area. An audited calculation of social insurance contributions gets low-level cases. A low-risk search screen stays at high level. On that screen, the tester picks the data during execution.

From acceptance criterion to test case

According to the ISTQB Acceptance Testing syllabus, an acceptance criterion is a measurable statement that is either true or false. It is a test condition: it says what to test without a detailed procedure. The acceptance test cases derive from the criteria and state how to verify each one. The business analyst and the tester begin writing the criteria and the tests together during elicitation. In agile work, they write them during requirements analysis and backlog refinement.

The SWEBOK gives the test case the general form "When given input that looks like X, we expect the software to produce results that look like Y." The sentence becomes a requirement when "the software shall produce" replaces "we expect the software to produce". A precise acceptance case thus states a requirement without ambiguity.

The tester derives the cases with the techniques of black-box testing. Equivalence partitions and boundary values cover a threshold. A decision table covers a combination of rules. A process model gives the paths to cover.

In acceptance test-driven development (ATDD), the team writes the cases before developing the user story. It starts with the positive cases, continues with the negative cases, then covers the non-functional characteristics. The cases cover the whole story without going beyond it. No two cases describe the same characteristic of the story.

What makes a good test case

A test case is also a means of communication. Another tester runs it, a developer reruns it after a failure, an auditor approves it. The Test Analyst syllabus lists quality criteria.

CriterionThe reviewer checks that
Correctnessthe case verifies the test condition it is based on
Feasibilitythe case can be executed
Necessitythe title names a clear objective that no other case covers
Understandabilitya person other than the author can review, modify and execute the case
Traceabilitythe case traces to its test condition, its requirement and its risk
Consistencythe language, format and structure match those of the other cases
Precisionthe case allows only one reading: no "suitable", no "as needed", no "several"
Completenessall required attributes are present, including the test data and the expected result
Concisenessthe case focuses on few coverage items
The quality criteria for a test case according to the ISTQB Test Analyst syllabus. For each criterion, the table gives what the reviewer checks.

The case "Check that the shipping fees are suitable for several baskets" fails on precision and completeness. It has no value and no expected result. The rewrite reads: "Basket of CHF 99.95; confirm the order; expected result: shipping fee of CHF 8.50".

Test data

A low-level case needs data: a customer, items, prices. The Test Analyst syllabus recommends separating the test logic from its data: the case or the script reads its values from a data set. A price change then touches one data row and no case.

Negative tests need invalid data: a negative quantity, an address outside Switzerland. Personas help the team build realistic profiles for synthetic data.

Sensitive data needs protection. Pseudonymisation replaces the identity with an artificial identifier. Anonymisation removes whatever identifies the person. In a HERMES project, a non-anonymised copy of production data used as test data must meet the ISDP requirements (information security and data protection).

From procedure to test script

The procedure orders the cases by their dependencies and their priority. Before the cases, it sets up the preconditions, for example by loading the test data. After the cases, it checks the postconditions and resets the database and the environment.

In ATDD and behaviour-driven development (BDD), the team often writes its cases in the structured language Gherkin: "Given" a situation, "When" an action, "Then" the expected result. The "Given" block puts the test object in a known state. The steps name user actions and never interface elements. A tool reads this structure and generates keyword-driven automated scripts from it.

Feature: Shipping fee by basket value
  Scenario: Basket just below the free-shipping threshold
    Given test customer C-017 is logged in with a delivery address in 1004 Lausanne
    And a basket worth CHF 99.95
    When the customer confirms the order
    Then the shipping fee is CHF 8.50
    And the order total is CHF 108.45
A low-level test case written in Gherkin. The Given block sets up test customer C-017 in Lausanne and the basket of CHF 99.95. The When block confirms the order. The Then block expects a shipping fee of CHF 8.50 and an order total of CHF 108.45.

Keyword-driven testing separates two layers. A keyword on the domain layer names a business action. The keywords on the test interface layer implement it. An action keyword acts on the test object. A verification keyword compares the actual result with the expected result. The test analyst specifies the keywords. A technical test analyst, a test automation engineer or a developer implements the scripts.

Domain keywordTypeTest interface keywords
Confirm orderactionopen the basket; click "Order"
Verify shipping fee (CHF 8.50)verificationread the "Shipping fee" field; compare with CHF 8.50
The keywords of case LL-03. A domain keyword names a business action or a check. The test interface keywords execute it.

The steps

  1. Gather the test basis. The analyst collects the requirements and the acceptance criteria in their current version. The analyst sends any criterion that cannot be judged true or false back to its author.
  2. Write the test conditions. Each criterion yields at least one condition: "basket above the threshold", "basket below the threshold".
  3. Choose the level area by area. High level is enough for what is low-risk or still unstable. Low level serves what is audited, automated or handed to novices.
  4. Derive the cases and set the coverage. A black-box test technique provides the coverage items: partitions, boundary values, rule combinations.
  5. Specify each case. Each case gets its objective, its preconditions, its data, its actions, its expected result with its oracle, its postconditions and its trace to the criterion.
  6. Review against the quality criteria. The analyst splits cases that are too long and deletes duplicates.
  7. Review with the business. The business analyst and the tester check that the criteria are clear and measurable. They check that the cases cover the criteria, the business processes, the business rules and the business risks.
  8. Implement. The team groups the cases into procedures, orders them by priority and dependency, writes the scripts and assembles the suites.
  9. Execute and log. The tester runs each case, records the actual result and links each defect to the case that revealed it. The test report keeps one line per case.

The business analyst in acceptance testing

During solution evaluation, the business analyst reviews the testers' procedures and scripts. The analyst clarifies open questions, helps create the data for the business tests and may help evaluate the results. In HERMES, the business analyst takes part in designing the test concept and in conducting the tests with the test manager, the tester and the user representative.

Pitfalls

The vague criterion turned into a test. Faced with a vague criterion, the tester guesses what the stakeholders expect. The Acceptance Testing syllabus describes what follows: wrong tests, rework, even the execution of invalid tests. The analyst returns the criterion to its author before writing the case.

The case that is too long. A case of twenty actions that fails at the third blocks the seventeen that follow. It also hides the cause of the failure. The Test Analyst syllabus prefers short cases on few coverage items. The team then combines them in several procedures.

The step that names the interface. "The customer clicks the green button at the bottom right" breaks at the next screen redesign. "The customer confirms the order" survives it. Interface detail belongs to the keywords of the interface layer.

Low level on an unstable basis. Low-level cases need a well-defined test basis. On requirements that still move, each change rewrites dozens of cases. The team writes high-level cases first. It refines them once the requirements settle.

AI considerations

According to the ISTQB CT-GenAI syllabus, a language model drafts a first set of cases from the requirements. It proposes preconditions, inputs, expected results and coverage criteria. It translates structured cases into manual procedures or into scripts for an automation tool.

The same syllabus names the hallucinations specific to testing: fictitious or irrelevant cases, wrong or non-executable scripts, cases that check acceptance criteria that do not exist. So the analyst links each proposed case to an existing criterion and deletes the cases that link to nothing. The analyst checks each expected result against the test basis. When the prompt lacks the rule, the model invents a plausible result. The analyst treats that result as a question for the owner of the rule.

The syllabus lists the exposure of sensitive data among the risks of GenAI in testing. An extract of orders with names, addresses, dates of birth and IBANs stays inside the organisation. Instead, the model generates synthetic test data that is close to the production data and complies with the application's formats and validation rules.

Examples

The table shows the step from high level to low level on a shipping-fee rule.

Rule LIV-03: shipping is free for orders of CHF 100.00 or more; below that, the shipping fee is CHF 8.50. Prices are multiples of CHF 0.05.
CaseCoversPreconditionsInputs and actionsExpected resultPostconditions
HL-01LIV-03; basket at or above the thresholdCustomer logged in; delivery address in SwitzerlandConfirm a basket of at least CHF 100.00Free shippingOrder recorded without a shipping fee
LL-01HL-01; boundary valueTest customer C-017 logged in; address 1004 Lausanne; basket emptyAdd item A-100 at CHF 100.00; confirm the orderShipping fee CHF 0.00; total CHF 100.00Order recorded with a total of CHF 100.00; basket empty
LL-02HL-01; partition above the thresholdTest customer C-017 logged in; address 1004 Lausanne; basket emptyAdd item A-250 at CHF 250.00; confirm the orderShipping fee CHF 0.00; total CHF 250.00Order recorded with a total of CHF 250.00; basket empty
HL-02LIV-03; basket below the thresholdCustomer logged in; delivery address in SwitzerlandConfirm a basket of less than CHF 100.00Shipping fee chargedOrder recorded with a shipping fee
LL-03HL-02; boundary valueTest customer C-017 logged in; address 1004 Lausanne; basket emptyAdd item A-099 at CHF 99.95; confirm the orderShipping fee CHF 8.50; total CHF 108.45Order recorded with a total of CHF 108.45; basket empty
LL-04HL-02; partition below the thresholdTest customer C-017 logged in; address 1004 Lausanne; basket emptyAdd item A-020 at CHF 20.00; confirm the orderShipping fee CHF 8.50; total CHF 28.50Order recorded with a total of CHF 28.50; basket empty
Test cases for rule LIV-03, which makes shipping free for orders of CHF 100.00 or more. High-level case HL-01 yields low-level cases LL-01 and LL-02. Case HL-02 yields LL-03 and LL-04. Each case carries its preconditions, its inputs and actions, its expected result and its postconditions.

LL-01 and LL-03 bracket the boundary: CHF 100.00 and its neighbour one CHF 0.05 step below. A developer who codes "over CHF 100.00" instead of "CHF 100.00 or more" makes only LL-01 fail.

Visualisations

In the diagram, the low-level case LL-03 opens into its four compartments.

Acceptance criterion
LIV-03: free shipping from CHF 100.00
Test condition
Basket below the threshold
High-level test case
HL-02: confirm a basket of less than CHF 100.00
Low-level test caseLL-03
Preconditions
Customer C-017 logged in; address 1004 Lausanne; basket empty
Inputs and actions
Item A-099 at CHF 99.95; confirm the order
Expected result
Shipping fee CHF 8.50; total CHF 108.45
Postconditions
Order of CHF 108.45 recorded; basket empty
Test procedure and test script
Test suite
Test result
Traceability
Acceptance criterion LIV-03 yields a test condition, then the high-level case HL-02 and the low-level case LL-03. A procedure orders the case, a script runs it and a test suite groups the scripts of one test run. Traceability links the result back to the criterion.

Cost

PhaseLevelRationale
PreparationMediumVerifiable acceptance criteria and test data to request or to generate.
ExecutionHighThe analyst writes each low-level case value by value. The team runs these cases at every release.
DocumentationHighEvery change to a requirement or to the interface means updating the affected cases, data and scripts.

Tooling

A spreadsheet is enough for a few dozen cases: one row per case, one column per element. HERMES publishes a template for the test concept and a template for the test report.

Xray and Zephyr in Jira, Azure Test Plans and TestRail manage the cases, procedures, executions and traceability to requirements. They come into play once several testers run the same suites.

Cucumber and Reqnroll run cases written in Gherkin. Robot Framework runs keyword-driven scripts. Playwright and Selenium drive the browser for the keywords of the interface layer.

Sources

Test and Inspection Planning
All techniques
The Eight Wastes