Acceptance Criteria

Acceptance criteria are a way to set a benchmark, a standard, that any delivered solution must meet. Naturally, it must be clear and binary. Clear in that the customer agrees that she is willing to accept a solution that meets the criteria, and binary in that either the delivered solution meets the criteria or it is rejected .

In Chapter 27 , we looked at fit criteria. Acceptance criteria are more or less the same thing: Both are concerned with making requirements measurable and testable. The difference is mainly in how you write them .

Stories are written to describe something—some functionality or non-functional attributes—that the customer needs to be included in the delivered product. The acceptance criterion looks in the other direction. It states whether that thing, whatever it is, has been successfully included in the delivered product .

Acceptance criteria should be written in the customer’s voice. The criteria should demonstrate the scope and the functionality that the customer needs from the story. They should also be written early. They give precision to your stories; just as fit criteria bring precision to your requirements. Try writing acceptance criteria in parallel with writing the business event story. It’s a great way to drive questions out early .

Write acceptance criteria in parallel with writing the business event story.

Let’s look at how to write acceptance criteria .

Given/When/Then

Given/when/then (from now on, we’ll call this GWT) is one of the most common forms of writing acceptance criteria (which we can abbreviate to AC) and is quite suitable to use when discovering requirements. And it works extremely well with business event stories.

Given/when/then is a construct that defines the start and end states of, well, anything, but in our case, we’ll use GWT for our business use cases. You write a GWT statement so that the stakeholders can understand the transaction and confirm that the GWT conditions are what they desire. The statement is as follows:

Given that [a context]

When [an action is carried out]

Then [a set of observable outcomes should occur]

Let us say that we have a business event, “A potential customer wants to subscribe to our streaming service.” The following is the business event story for this:

As a movie fan

I can subscribe to the service

So that I can stream movies as I wish.

“Given” specifies the state of the solution’s universe before the story begins to execute. For example, you could say:

Given the potential subscriber is a real and identifiable person, living in an approved country, with an acceptable means of payment

“When” is an action that takes place, and “Then” is the result of that action. For business event stories, read the “When” part as the business event. For the above movie streaming service:

Given the potential subscriber is a real and identifiable person, living in an approved country, with an acceptable means of payment

When a potential customer wants to subscribe to our streaming service

Then an account is established for the subscriber, his payment method is charged for the first month’s subscription, and he is given logon details.

Let’s take this example of a story:

As a road engineer

I can generate a road treatment schedule

So that the depot and the truck drivers are made aware of which road sections are predicted to freeze within the selected time parameters.

You could write the acceptance criterion thus:

Given the weather forecast is available and was forecast within the previous 15 minutes, and all weather stations are online

When an authorized engineer supplies the appropriate time parameters and areas to be forecasted

Then the product produces a schedule of road sections where temperatures are 32°F (0°C) or below, and either moisture is present or precipitation is predicted within the next hour.

Another example:

Given a road is part of the district being monitored by the product

When the driver reports the road has been successfully treated (roads are treated by trucks with a human driver)

Then the road status is changed to “safe” and the road is removed from the predicting activity for the next four hours.

You can see that the acceptance criteria and the story are both saying the same thing (as they should). Some teams prefer to replace the story with the AC in its Given-When-Then form.

That’s fine when you are working at the business event level. As the business event story moves into development, it is sliced into smaller units of functionality to make implementation more manageable. This means that your acceptance criteria become more detailed—they are specifying a subset of the business use case—and they begin to focus on more technical matters.

However, you must always keep in mind that requirements, whether they are written as stories or acceptance criteria, must be testable. If something is not testable, then it has no place in your solution.

When you write the acceptance criteria for a story, the GWT statement is setting down the testable end conditions for the functionality it covers.

This is the GWT for the business event “Customer wants to watch a movie”:

Given a customer has an account and is correctly logged on

When a customer wants to watch a movie

Then the movie will be streamed until it ends or is paused or stopped by the customer.

The “Then” line is testable. You can determine absolutely that a movie is streaming to the right destination, you can test that it runs to its ending and the credits have rolled, and you can test the other “Then” conditions. Moreover, your stakeholders can agree that what they need to happen does in fact happen.

Another example:

Given the customer’s payment method is current and there are items in the basket

When the customer signals that she wants to check out

Then the delivery address is confirmed, the customer’s chosen payment method is debited, and the items in the basket are recorded as sold and transferred to the fulfillment system.

We have been talking about GWT statements at a business event story level. This is intentional, as it is at this level that GWT is most effective. As mentioned, the “When” part is when the business event happens. The “Then” statement is the outcome and must be agreed to by the stakeholders that this is the outcome they need. If there is no agreement, then you have more work to do to discover the real intention of this business event. This is a crucial part of your requirements discovery.

Later, your stories are broken down for implementation reasons, and you can still write GWT statements for all of the lower-level components. However, keep in mind that these lower-level components contribute to the goal of the business event. So, in many cases, you can abbreviate the acceptance criteria to a checklist of items to be achieved by whatever unit of functionality you are dealing with.

A word of caution: Some teams end up writing GWT statements to such a granular level of detail that each story ends up looking like a huge requirements document. Try to avoid this; the purpose is to produce a testable set of stories, not to produce a specification longer than The Lord of the Rings .

Who Writes the ACs, and When?

Business analysts are the ideal people to write the acceptance criteria for stories. Business analysts—the requirements discoverers—are the people closest to the customers and what they need to achieve. Most of what you have read so far in this book is about understanding the customers and what is needed for their work. In some cases, product owners or product managers write ACs, but care must be taken that they are written from the perspective of the customer and not based on the needs of the product.

We strongly suggest that you write acceptance criteria early in the project at the point you establish the business events. If each business event has its GWT statement, everybody understands the importance and the effect of each of the business events.

It also gives your client the information she needs to assess the value of the project overall. GWT deals in outcomes, so having them for all business events enables the development team and the client to agree on the necessary outcomes for the delivered solution to fulfill the client’s requirements.

Review

Given/when/then is not the only way to write your acceptance criteria, but it is effective and so widely used that there is little point in talking about alternatives. How you write your acceptance criteria is not important; that you write acceptance criteria is very important.

Your acceptance criteria set down the litmus test for the business use case that responds to a business event. In other words, GWT says that when this business event happens, providing the solution space is in the nominated state, the solution provides this desired outcome.

Without specifying the outcome, you cannot be sure that your solution is what is needed. It is the acceptance criteria that set down what your customer will accept.

Resources

Discover to Deliver: Agile Product Planning and Analysis by Ellen Gottesdiener and Mary Gorman (EBG Consulting, 2012). The authors mention how GWT can be used in business analysis.