SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
Test Analysis and Design

ISTQB CTFL Collaboration-based Test Approaches: User Stories, Acceptance Criteria and ATDD

12 min readCTFL · Test Analysis and DesignUpdated

Collaboration-based test approaches are test approaches in which business representatives, developers and testers work together on user stories, their acceptance criteria and the tests derived from them, so that defects are avoided before code is written. This CTFL lesson covers the 3 Cs and the template of a user story, how and why stories are written collaboratively, the INVEST criteria, what acceptance criteria are for and the scenario-oriented, rule-oriented and custom formats, and how acceptance test-driven development (ATDD) turns acceptance criteria into test cases.

What you’ll learn
  • Describe the 3 Cs of a user story (Card, Conversation, Confirmation) and the common story template
  • Explain why user stories are written collaboratively, with which techniques, and how INVEST describes a good story
  • Interpret what it means when stakeholders cannot say how to test a story
  • Explain what acceptance criteria are and the five things they are used for
  • Classify acceptance criteria as scenario-oriented, rule-oriented or an acceptable custom format
  • Describe the ATDD process: specification workshop, who writes the tests and when, and how they are expressed
  • Apply ATDD to derive test cases from acceptance criteria in the right order, with complete coverage and no duplicates

What are collaboration-based test approaches?

Collaboration-based test approaches are ways of designing tests in which business representatives, developers and testers work together to avoid defects rather than only to find them. The other test techniques in this part of the syllabus (black-box, white-box and experience-based) focus on detecting defects; collaboration-based approaches focus on defect avoidance through collaboration and communication, by making sure everyone understands the same thing before anything is built.

The CTFL syllabus covers three linked practices:

  • Collaborative user story writing (FL-4.5.1): the business, development and testing perspectives write the story together.
  • Acceptance criteria (FL-4.5.2): the conditions that decide whether the story's implementation is accepted, written in a scenario-oriented, rule-oriented or other clear format.
  • Acceptance test-driven development (ATDD) (FL-4.5.3): a test-first approach that derives test cases from the story and its acceptance criteria before the code is written.

Where ATDD sits among the other test-first approaches (TDD and BDD) is covered in the lesson on testing in the SDLC; this lesson is about doing it.

What is a user story? The 3 Cs and the template

A user story represents a feature that will be valuable to a user or purchaser of a system or software. A user story has three critical aspects, known as the 3 Cs:

AspectWhat it is
CardThe medium describing the user story, such as an index card or an entry on an electronic board.
ConversationExplains how the software will be used. It can be documented or verbal; spoken discussion counts as the conversation even when it is never written down.
ConfirmationThe acceptance criteria, which confirm the story is done.

The acceptance criteria are the content of the confirmation, not a separate fourth item.

The most common format for the story itself is:

As a [role], I want [goal to be accomplished], so that I can [resulting business value for the role].

A complete story statement has all three parts: who wants it, what they want, and why it is valuable to them. For example, "As a nurse, I want to see today's medication schedule" names a role and a goal but not why it matters, so it is incomplete; adding "so that I can give each dose on time" supplies the value. The final "so that" part is always the business value for the role. The template is followed by the acceptance criteria.

Why write user stories collaboratively, and how?

Writing user stories collaboratively gives the team a shared vision of what should be delivered, because each participant contributes their own perspective:

  • Business representatives bring what is valuable and why.
  • Development brings what is feasible and how much effort it needs.
  • Testing brings how the result will be checked, including the cases nobody mentioned.

Techniques such as brainstorming and mind mapping can be used for this collaborative authorship.

A story written from only one perspective tends to miss what the others would have spotted: whether the value is clear, whether it is feasible, and how anyone will check it. Writing the story together and agreeing its acceptance criteria up front gives everyone the same picture of "done", which makes the story testable and gives the team a common basis for estimation.

What makes a good user story? INVEST

Good user stories meet the INVEST criteria:

LetterPropertyMeaning
IIndependentThe story can be developed and delivered without depending on other stories.
NNegotiableThe details stay open for discussion between the business and the team until the story is developed; it is not a fixed contract.
VValuableIt delivers value to a user or purchaser.
EEstimableThe team can estimate the effort to build it.
SSmallIt is small enough to complete within an iteration.
TTestableSomeone can say how to check that it is done.

The T stands for Testable. A story that asks for monthly reports to be "easy to read" is a typical failure: with no agreed measure, nobody can say how to confirm it is done.

When stakeholders cannot say how to test a story

If stakeholders do not know how to test a user story, the syllabus gives three possible reasons:

  • the story is not clear enough;
  • it does not reflect something valuable to them; or
  • the stakeholders simply need help with testing.

Read the situation to choose between them: if the stakeholders already agree the story is clear and valuable, the remaining explanation is that they need help with testing.

What are acceptance criteria and what are they used for?

Acceptance criteria for a user story are the conditions that an implementation of the user story must meet to be accepted by stakeholders. From this perspective they can be viewed as the test conditions that should be exercised by the tests. They are usually a result of the conversation.

They belong to one user story. The acceptance criteria may also detail some of the issues described in the story. The syllabus lists what acceptance criteria are used to do:

  • define the scope of the user story (its boundaries);
  • reach consensus among the stakeholders;
  • describe both positive and negative scenarios;
  • serve as a basis for user story acceptance testing;
  • allow accurate planning and estimation.

Acceptance criteria say what the implementation must achieve to be accepted; they do not prescribe how developers implement the logic or design the code. They support the conversation rather than replace it, and they are not a place to record defects.

How can acceptance criteria be written? Scenario-oriented, rule-oriented or custom

There are several ways to write acceptance criteria for a user story. The syllabus names the two most common formats and allows others:

FormatWhat it looks likeExample
Scenario-orientedGiven/When/Then, the format used in BDD.Given the user is signed in, When they change the delivery address, Then the new address appears on the order summary.
Rule-orientedA bullet-point verification list, or a tabulated form of input-output mapping."Only one discount code per order"; "Discount codes are not case-sensitive"; or a table of parcel weights with the expected postage for each.
Other (custom)Any team-defined format.Short numbered sentences in a house template.

Both a bulleted list and an input-output table are rule-oriented: the table is still a set of rules, just tabulated. Given/When/Then is always scenario-oriented. A custom format is acceptable as long as the acceptance criteria are well-defined and unambiguous. Clarity is the test, not the layout.

How does ATDD work? From specification workshop to tests

Acceptance test-driven development (ATDD) is a test-first approach: test cases are created prior to implementing the user story. They are created by team members with different perspectives, such as customers, developers and testers. ATDD runs in this order:

  1. Specification workshop. The first step: the user story and (if not yet defined) its acceptance criteria are analysed, discussed and written by the team. Incompleteness, ambiguities and defects in the story are resolved during this process, and the resolution goes into the acceptance criteria. If, for example, the team notices a shared shopping-list story never says what happens when two family members edit the list at once, they agree the behaviour in the workshop and write it into the criteria.
  2. Create the test cases. This can be done by the team as a whole or by a tester individually. Either way it happens before coding. The test cases are based on the acceptance criteria and can be seen as examples of how the software works, which helps the team implement the story correctly.

Implementation of the feature then follows; if the tests are automated, developers write the supporting automation code during that implementation.

Since examples and tests are the same, the terms are often used interchangeably. During test design the test techniques described in the rest of this domain (equivalence partitioning, boundary value analysis and so on) may be applied.

How ATDD tests are expressed

Typically the test cases are written in natural language that stakeholders can understand, containing the necessary preconditions (if any), the inputs and the postconditions. They are not unit-level code tests, which is what TDD produces. ATDD tests may be executed manually or automated. When the tests are captured in a format supported by a test automation framework, developers can automate them by writing supporting code; the acceptance tests then become executable requirements.

Which ATDD tests are written, in what order?

ATDD test cases are typically written positive first, then negative, then non-functional:

  1. Positive tests first: they confirm the correct behaviour without exceptions or error conditions, covering the sequence of activities executed when everything goes as expected.
  2. Negative tests next: invalid inputs, rejected requests and error conditions.
  3. Non-functional characteristics last: for example performance efficiency (such as an agreed response time) or usability.

For a document upload story, that means "a PDF within the size limit is uploaded and listed" (positive), then "a file over the size limit is rejected with a message" (negative), then "an upload completes within the agreed time" (non-functional).

Coverage rules

The test cases must:

  • cover all the characteristics of the user story;
  • not go beyond the story: a test for behaviour the story and its criteria do not mention (an export, an email, a future extension) does not belong;
  • not duplicate: no two test cases should describe the same characteristic of the story.

So when reviewing a draft set, drop any test that repeats a characteristic already covered (for a gym class booking story, booking a different class that has free places is still the same characteristic as booking one), drop any test outside the story, and add a test for any characteristic nobody has covered yet (cancelling a booking, if the criteria allow it), rather than another variation of one already tested.

Worked example: deriving ATDD test cases from acceptance criteria

Deriving ATDD test cases (the K3 objective) means turning each acceptance criterion into at least one concrete example with a precondition, input and expected result, then checking the set against the order and coverage rules.

Each criterion gets its expected result from the criteria

Criteria for a single-use coupon: Given the coupon has not been used, When the customer applies it, Then 10% is taken off the order and the coupon is marked used. Given the coupon has already been used, When the customer applies it, Then it is rejected and the order total is unchanged.

TypePreconditionInputExpected result
PositiveUnused coupon, order total 80Apply couponTotal 72, coupon marked used
NegativeCoupon already used, order total 80Apply couponRejected, total stays 80

A negative test is defined by an input or state that violates the condition and by an expected result taken from the criteria. The tester does not invent the outcome; the criteria state it.

Applying boundary value analysis inside ATDD

Criteria: customers aged 18 or older may buy the product; younger customers are refused. Ages are whole years. "Or older" puts 18 in the allowed partition, so the boundary sits between 17 (largest refused value) and 18 (smallest allowed value). With 2-value boundary value analysis the tests are 17 (refused) and 18 (allowed): one test per criterion, each on its own side of the boundary. Reading an inclusive threshold ("or more", "or older", "at least") correctly is what places the boundary value in the right partition.

Each test should fail if its rule were missing

Criteria: orders of 100 or more get a 10% discount; the discount is recalculated whenever an item is removed. "Basket of 120: discount applied" covers the first rule. For the recalculation rule, a useful test is "basket of 110 with a discount, remove an item worth 20: total 90 with no discount": without recalculation the discount would stay, so the test reveals whether the rule is implemented. A test such as "basket of 60, remove an item: no discount" would pass whether or not recalculation exists, so it proves nothing about that rule.

Tip. Questions on this topic are mostly short recall and understanding items, often with an uppercase qualifier such as BEST, CORRECT, NOT or FIRST. Expect to name the 3 Cs or identify which C a situation describes, complete or judge a story against the role-goal-value template, recall what a letter of INVEST stands for or which property a story fails, and interpret stakeholders who cannot say how to test a story. Acceptance-criteria items ask for their definition and uses (and what is not a use), and to classify examples as scenario-oriented, rule-oriented or an acceptable custom format, sometimes in a roman-numeral or three-way classification item. ATDD items cover the specification workshop as the first step, who writes the tests and when, how they are expressed, executable requirements and the positive-negative-non-functional order. Application items give a story with its criteria and ask which test cases to add, which to drop as duplicates or out of scope, which negative test is correct, or which boundary values to use when a technique such as 2-value boundary value analysis is applied inside ATDD. The comparison of TDD, ATDD and BDD as lifecycle practices is tested in the SDLC topic.

Key takeaways
  • A user story has 3 Cs: Card (the medium), Conversation (how the software will be used, documented or verbal) and Confirmation (the acceptance criteria).
  • Story template: As a [role], I want [goal], so that [resulting business value for the role].
  • Writing stories with business, development and testing gives a shared vision of what to deliver; brainstorming and mind mapping help.
  • INVEST: Independent, Negotiable, Valuable, Estimable, Small, Testable.
  • Stakeholders who cannot say how to test a story signal an unclear story, a story not valuable to them, or a need for help with testing.
  • Acceptance criteria are the conditions for stakeholders to accept the implementation; they set scope, build consensus, cover positive and negative scenarios, are the basis for acceptance testing and enable estimation.
  • Given/When/Then is scenario-oriented; a verification list or an input-output table is rule-oriented; any other format works if well-defined and unambiguous.
  • ATDD starts with a specification workshop; tests are written before implementation by the team or a tester, in natural language with preconditions, inputs and postconditions.
  • ATDD order: typically positive tests, then negative tests, then non-functional characteristics.
  • ATDD tests cover every characteristic of the story, nothing beyond it, and no two tests cover the same characteristic; automated, they become executable requirements.

Frequently asked questions

What are the 3 Cs of a user story in ISTQB CTFL?

The 3 Cs of a user story are Card, Conversation and Confirmation. The card is the medium describing the story, such as an index card or an entry on an electronic board. The conversation explains how the software will be used and can be documented or verbal. The confirmation is the acceptance criteria.

What does INVEST stand for in user stories?

INVEST stands for Independent, Negotiable, Valuable, Estimable, Small and Testable. It describes the properties of a good user story; for example, Negotiable means the details stay open for discussion until the story is developed, and Testable means someone can say how to confirm it is done.

What is the difference between scenario-oriented and rule-oriented acceptance criteria?

Scenario-oriented acceptance criteria use the Given/When/Then format used in behaviour-driven development, describing a situation, an action and an outcome. Rule-oriented acceptance criteria are either a bullet-point verification list or a table mapping inputs to expected outputs. Other custom formats are also acceptable if the criteria are well-defined and unambiguous.

What are acceptance criteria used for?

Acceptance criteria are the conditions a user story's implementation must meet to be accepted by stakeholders. They are used to define the story's scope, reach consensus among stakeholders, describe both positive and negative scenarios, serve as the basis for acceptance testing of the story, and allow accurate planning and estimation. They do not prescribe how the code is implemented.

What is the first step in acceptance test-driven development (ATDD)?

ATDD starts with a specification workshop, in which the team analyses, discusses and writes the user story and its acceptance criteria. Incompleteness, ambiguities and defects in the story are resolved during the workshop, before any test cases are written or code is implemented.

Who writes ATDD test cases, and when?

ATDD test cases are written before the user story is implemented. They come from people with different perspectives, such as customers, developers and testers, and after the specification workshop they can be written by the team as a whole or by a tester individually. They may be executed manually or automated.

In what order are ATDD test cases written?

ATDD test cases are typically written in this order: positive tests first, confirming correct behaviour when everything goes as expected, then negative tests covering invalid inputs and error conditions, and finally tests of non-functional characteristics such as performance efficiency or usability.

What are executable requirements in ATDD?

Executable requirements are ATDD acceptance tests that have been captured in a format supported by a test automation framework and automated by developers writing supporting code. The natural-language tests stakeholders agreed then run directly against the software, so the requirements themselves are executed.

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.

Test yourself on this topic
Practice now

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?