Overview

In Agile Methodologies, Acceptance Criteria (AC) are used to define when a given user story can be "accepted" by some relevant stakeholder.


The criteria that a component or system must satisfy in order to be accepted by a user, customer, or other authorized entity. - ISTQB Glossary


Acceptance Criteria:

But the following question arises: How can we know whether a certain criterion has been checked or validated by testing?

Before diving into it, we need to be aware of typical patterns teams follow for handling AC.


"Accepting" the story doesn't mean it's bug-free or that acceptance criteria should describe all possible usage scenarios about the story; it's only a way to clarify some usage rules that are important for some stakeholders and that the user story "can work".

A common misconception is on "done" vs "acceptance criteria". Acceptance criteria are user story specific, while the definition of done applies to all product increments/user stories. 

Therefore the fact that acceptance criteria have been met, doesn't mean it can be considered as "done" and thus ready to be shipped.

Jira and Acceptance Criteria

Jira doesn't enforce a way of handling AC.

Usually, teams describe AC as a list in the Description field of the related Story.



AC can be enumerated using bullets: either numbered bullets or standard ones but with some prefix.

This is an unstructured approach that inhibits full traceability between story<=>AC<=>tests<=>test runs<=>defects.

Some teams may decide to use specific custom fields for this purpose or even to use specific Jira apps/plugins to clearly manage AC. However, these usually don't have unique IDs that can be referred elsewhere.

Xray and Acceptance Criteria

Xray does not provide nor enforce a way of handling AC. But, you can take advantage of some built-in capabilities to have more explicit visibility of it.

While most teams create Tests and associate them to the related requirements/stories (e.g., Story<=>Test(s)), this may not be sufficient if you want to analyze each criterion individually.

If you aim to understand which Tests address a specific acceptance criterion and how it is based on the related testing results, then we need to turn each acceptance criterion into a manageable, identifiable, and coverable entity.

That will allow us to have more detailed traceability, such as Epic<>Story/ies<>Acceptance Criteria<>Test(s), and track the coverage status up to the Acceptance Criteria level.

Having explicit visibility of Acceptance Criteria and tracking their status with Xray

AC implemented as "sub-requirements" in Xray

Xray supports the concept of requirements and sub-requirements.

In this approach, a given story/requirement is decomposed into multiple sub-requirements, which in turn can be covered by tests.

The sub-requirement, in this case, is our acceptance criterion that will be implemented as an issue.

We can define the relation between the Story and related acceptance criteria based on a sub-task or on a specific issue link type, accordingly to what we have defined on Xray coverage-related settings.


Configuring it

  1. Create an issue type named "Acceptance Criterion" or equivalent. Go to Jira Settings > Issues > Issue Types.
  2. Add that issue type to the issue type scheme used by your Jira project
  3. Define in Xray settings, the sub-requirement (e.g. the "Acceptance Criterion" issue) to be handled as a coverable issue (i.e. by adding it to the "Requirement Issue Types" column) 
  4. Define in Xray settings, the relation between the parent requirement (e.g. the "Story" issue) and the sub-requirement (e.g. the "Acceptance Criterion" issue)
    1. Note: if you want to define this relation based on a custom issue link type (e.g., you could create a "Satisfy: satisfies/is satisfied by"), then you need to create it first
      1.  


In Xray, sub-requirements can be identified and related to parent requirements using:

  • a specific, configured, issue link (e.g., you could create a "Satisfy: satisfies/is satisfied by")
  • sub-tasks

Using sub-tasks may allow further control over the progress of the parent issue (e.g. the Story), such as giving the ability to restrict closing it or not. However, the usage of "sub-tasks" namely for this purpose, is something that has to be evaluated in your specific context. 

To use sub-tasks:

  1. Please make sure they are enabled. Go to Jira Settings > Issues > Issue types > Sub-tasks.
  2. Create the sub-requirement/acceptance criterion as a sub-task issue type. Go to Jira Settings > Issues > Issue Types
  3. In Xray settings, make sure the Issue-Sub-tasks relationship is defined for test coverage hierarchy


Using it

Create the Story as usual. The story may be part of an Epic or not.


Then create the Acceptance Criterion issues. The exact details depend on how you decided to implement the AC and relate them to the Story issues:


From the Acceptance Criterion issue create Tests and execute them as usual, reporting the final status (e.g., PASSED/FAILED)

   


You can then check coverage directly on the Story, which is based on all related testing results (i.e., results from Tests covering all the related Acceptance Criterion issues).


You can also go to each Acceptance Criterion issue to understand if it's being satisfied or not, based on the coverage information, which in turn is based on the related testing results. In this example, one of the AC (CALC-1305) is NOK. 

  


In the Traceability Report, it's possible to see full traceability between Epic<=>Stories<=>Acceptance Criteria<=>Tests<=>Test Runs<=>Defects. The following screenshot clearly shows this hierarchy:


Supported features


Supported?
create one or more AC per Story/requirementx
uniquely identify each ACx

ability to create linkable references to AC 

(.e.g ability to mention AC from somewhere else)

x
AC as issuesx
see AC on the Story/requirement issue screen along with their statusx
link Tests to each ACx
"ignore" AC without Tests for the calculation of coveragex

full traceability

story/requirement<=>AC<=>tests<=>test runs<=>defects

x

FAQ

References