A Formula for Great Gherkin Scenarios (with Given-When-Then Examples) » Business Analysis Experts

A Formula for Great Gherkin Scenarios (with Given-When-Then Examples) » Business Analysis Experts

[ad_1]

Given-When-Then Examples for Non-functional Requirements (NFRs)

Most of your Scenarios will test the functionality of the product or feature, but non-functional testing is as important as functional testing. If you want to ensure customer satisfaction do not neglect writing Scenarios that test Non-Functional Requirements (NFR) of the product as well.

As a refresher, NFRs express conditions such as how many, how often, how fast, how friendly, etc. Any of the four common types (Constraints, Performance, User Experience, or Volatility) should be tested. Testing Non-Functional Requirements can be extremely time- and resource-intensive. For that reason, many organizations have specialists whose primary job is performance testing, security testing, usability testing, etc.

However, if an NFR is important to the success of a product or feature, you should define User Acceptance Criteria or UAT Test Cases that will instill the confidence that the Non-functional Requirement has been met.

Here is an example to illustrate:

As golf tournament director, I can adjust a player’s net stroke play scores using their individual USGA handicaps to determine their net placement in the tournament.

User Story Decomp revealed the following NFR:

A player’s handicap must be a valid USGA handicap

There are definitively two Scenarios needed for this NFR. One where the player has a valid USGA handicap and another where they do not.

For example, if the player has proof of their USGA handicap, the Scenario reads:

Scenario: Golfer registers with a valid USGA handicap
GIVEN Golfer has signed-up for the tournament
AND Golfer registers on the day of tournament for play
WHEN Golf Pro requests proof of USGA handicap
AND Golfer shows an official USGA handicap card
THEN Golfer is assigned a tee time

And if the player has no official USGA handicap:

Scenario: Golfer registers without a valid USGA handicap
GIVEN Golfer has signed-up for the tournament
AND Golfer registers on the day of tournament for play
WHEN Golf Pro requests proof of USGA handicap
AND Golfer does not have an official USGA handicap card
THEN Golfer leaves in tears because he is not allowed to play

You could have more Scenarios for this NFR. For example: What if a player from Europe participates? Handicaps in Europe are regulated by the R&A (Royal and Ancient Golf Club, based in St. Andrews, Scotland). This may require another Scenario unless an R&A handicap is accepted by the USGA as “official” handicap.

[ad_2]

Source link