ai-test, tutorial,

How use AI (Copilot) to write an User Story, Gherkin Test cases

Donald Donald Follow Apr 09, 2024 · 2 mins read
How use AI (Copilot) to write an User Story, Gherkin Test cases
Share this

How use AI (Copilot) to write an User Story, Gherkin Test cases

In this post, I would like to share with you the simple case I use some AI chatbox to help me complete the daily tasks of software engineering in a Sprint.

Let us to go through these activities that we will have to do normally in each sprint:

  • Create a user story to demonstrate the business value and acceptance criteria that each story bring value to End Users
  • Based on the vital information of each user story, we will have to define the essential test cases that should be covered and tested to assure the quality of products and meet the customer’s requirement.

For instances, we have a simple task:

Write the userstory and accepta criteria:
Given user access to my first screen application 
and see the link sign-up with a phone number and username password texbox 
to input their credentials. 

Creating UserStory

We will ask Copilot AI from Microsoft with ChatGPT model 4.0 to answer our questions and help us complete this tasks:

walking

And here is the response from Copilot:

we can get that AI helps us complete the tasks when we expect to write more detailed information for user-story

walking

In real scenario, the content of userstory can be adjusted with several reasons. then we will be expected to update again the user story content. we will give the example scenario to AI, and we expect that AI will update again our user story content.

I would like to add more details that Sign-up link should be bellow Sign-in button. could you helo me rewrite again above userstory

and here is example answer:

walking

walking

Comparation before and after the update userstory:

Before

walking

After

walking

Create test cases - Gherkin BDD

Asking the our AI model (Copilot). Could you help me write Gherkin scenario testing for above user story

walking

walking

In short, AI can become the best supports for software engineering to handle more tasks easily and boost the productivities.

Join Newsletter
Get the latest news right in your inbox. We never spam!
Donald
Written by Donald
Hi, I am Donald (Doai Tran), the author of Testing4Everyone. I hope you like it!