The linguistic description of the use case looks like this: A thought, a task, an idea or an appointment is written down and collected in a so-called "inbox" with a few words or a short text. You can later access your notes in this inbox at any time.
Define the acceptance test scenarios
But before we start with the first feature “Collect Thoughts”, let’s first define the acceptance tests for this feature:
Feature: Capture Stage
Scenario: Collect Thought
When Thought "Send Birthday Wishes to Mike" is collected
Then Inbox contains "Send Birthday Wishes to Mike"
src/test/resources/features/collect-thought.feature
Now something magical happens! This is because the acceptance test scenarios are not defined in the QA phase after the feature has been implemented. Instead, the acceptance tests are created before the task of implementation is even handed over to the developer. This approach is called the shift-left approach. The QA task of defining acceptance kuwait consumer email list test scenarios at the end of the process is shifted (from the right) to the beginning of the process (further to the left). This approach has the following advantage: Instead of formulating a general idea of the feature in just one or two sentences, the requirement for the feature must be described precisely. This forces developers to go into greater detail.
Let's start with the setup
This task is a standard one: we start a Java/Maven project and let IntelliJ generate the first pom.xml. We add a few dependencies for an in-memory database for the tests and Cucumber to the pom.xml:
Since I want to start a Spring Boot project and I am a fan of Lombok, I add the following dependencies and the Spring Boot starter parent relationship to the pom.xml:
The data source must be configured. It will be used in normal operations of our application in the src/main/resources/application.yml :
A small note: The PostgreSQL database can docker run --name postgres-db -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgresbe started very easily with . The database and the user can be created with CREATE DATABASE... and CREATE USER...
We need to configure an alternative data source to be used when unit testing our application in the src/test/resources/application.yml:
I'm getting a little off topic now, but this information is still important. Many projects forget to set up their code base for this type of testing (integrative unit testing with an embedded database) as early as possible. So my suggestion is to create it as early as possible, before you write the first line of productive code for your project. This will give you clean testing opportunities for all developers during project development.
Define the acceptance test scenarios
-
suchona.kani.z
- Posts: 237
- Joined: Sat Dec 21, 2024 5:51 am